"Hello ATGC!" 4 4+5 (4+2-11)*3 from math import exp exp(-9) from math import sin,pi sin(pi/3) print("Welcome to python for life-science course!") print("The product of 7 and 8 is",7*8) # Your code here: print("I'm a genius!") print("7 + 6 =",7+6) print("My name is Inigo Montoya") a = 5 print(a) a + 7 b = a * 2 a + b print("a is",a) a = 8 print("and now a is",a) print(b) type(a) seq = 'ATGCGTATAGCAGATACAGt' type(seq) pi = 3.14159265359 type(pi) booly = True type(booly) print("This will be printed") # print("This will not be printed") print("Another example") # of a comment num1 = 8 num2 = 5 num1 + num2 num1 - num2 num1 * num2 num1 / num2 num1 // num2 num1 % num2 num1 ** num2 # Define a and b a = 10 b = 4.7 # calculate hypotenuse c = (a**2 + b**2)**0.5 # print result print(c) num1 == num2 # Note: '==', not '=' num1 == 8 num1 > num2 num2 > num1 num1 != num2 num2 < 5 num2 <= 5 plant = 'Arabidopsis thaliana' mammal = 'Mus musculus' plant == mammal plant > mammal plant <= mammal (num1 > num2) and (num1 != num2) (num1 != num2) and (num1 < num1) (num1 != num2) or (num1 < num1) num1 == 3 or num2 == 10 or num2 > 7 not (num1 > num2) not (num1 < num2) boolean = (num1 > num2) type(boolean) (boolean) and num2 == 5 if num1 > num2: print('Yes') if num1 < num2: print('Yes') if num1 > num2: print('Yes') print('Another operation will follow') num1 = 10 print(num1) x = 15 y = 8 if (x > 10 and y < 10) or x * y == 56: print('Yes') x = 9 if (x > 10 and y < 10) or x * y == 56: print('Yes') x = 7 if (x > 10 and y < 10) or x * y == 56: print('Yes') x = 442 if x % 17 == 0: print('Number is devisible by 17!') print('End of program.') x = 586 if x % 17 == 0: print('Number is devisible by 17!') else: print('Number is not devisible by 17!') print('End of program.') x = 586 if x % 17 == 0: print('Number is devisible by 17!') elif x % 2 == 0: print('Number is not devisible by 17, but is even!') else: print('Number is not devisible by 17, and is odd!') print('End of program.') # Choose a year year = 1492 # test year if (year % 400 == 0 or (year % 4 == 0 and year % 100 != 0)): print(year,"is a leap year") else: print(year,"is not a leap year") from random import randint random_num = randint(1,100) while random_num <= 90: # condition print(random_num) # indented block random_num = randint(1,100) print ('Found a number greater than 90!', random_num) from random import randint counter = 1 random_num = randint(1,100) while random_num <= 90: # condition print(random_num) # indented block random_num = randint(1,100) counter = counter + 1 # what's happening here? print ('Found a number greater than 90!', random_num, '. It took',counter,'tries.') m = 555 # integer to apply the conjecture on n = m while n != 1: print(n, end=", ") # if n is even if n % 2 == 0: n = n // 2 # if n is odd else: n = 3 * n + 1 print(1) # 1 was not printed print(m, "is OK")