name = 'Greedy' condition = 'special' time = 'all of the time' print ( '{} is {} {}.' .format(name , condition , time)) def calc (x , y , operation): if operation == 'add' : return x + y elif operation == 'sub' : return x - y elif operation == 'mul' : return x * y elif operation == 'div' : return x / y running = calc( 14 , 2 , 'div' ) print (running) running2 = calc( 12 , 2 , 'add' ) print (running2) print (running + running2) xyz = [] names = [ 'Mud' , 'Jebidiyah' , 'Florian' , 'Hans' ] for i in list (names): xyz.append(i) for i in range ( 20 ): xyz.append(i) print (xyz) num_list = [ 10 , 3 , 45 , 65 , 40 , 7 , 6 , 9 , 100 ] def div_five (num): if num % 5 == 0 : return True else : return False # So this is basically saying that fives equals any number in the list that passes the # ...
Comments