# print "Hello World" #my_str = "World Hello" #result = 123+145 # typecast operators, keine Rundung # zeichenkette string str() # gleitkommazahl float: float() # ganzzahl integer: int() #print int(result) # print flat(int(result)) = 268.0, auch wenn Falsch z.B. #print "the result is " + str(result) + " and the msg is " + my_str #print "the maessage is " + my_str #my_list = [ 12, 141, 345, 5, 3, 958] #print my_list #print my_list[0] # Liste beginnt mit 0, nicht 1 #print my_list [2:4] # mit : wird alles danach genommen, [2:4] = werden nur die 2 verwendet my_colleagues = ["Sila", "Chiara", "Selma", "Amelie", "Leon"] print my_colleagues #print my_colleagues [3] = "Amelie" #print my_colleagues [0] #print my_colleagues [1] #print my_colleagues [2] #print my_colleagues [3] #print my_colleagues [4] #Stattdessen: #print len(my_colleagues) # checkt wie lange eine Liste oder str ist i = 0 while (i < len(my_colleagues)): print my_colleagues [i] i = i+1 # ist komplezierter, stattdessen ist der 'for x in' befehl kompakter for x in my_colleagues: print x print "Hello World"