Monday, March 20, 2017


#boolean data types


 # continues executing the instruction while the condition is true while (condition)
 count =0
 #use while when you don't know how much you have to loop it

 while (count<20):

     if count==5:
         break #stop the loop
     #count =count +1
     count +=1

 #input loop
     inputString =input("Say something\nType Q to quit\n")
     if inputString =='Q':
     print (inputString)

 #usally very useful is list

weekdays = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"]
for day in weekdays:
    print (day)

#range in function, range (start,stop,step

for i in range (0,11):

for x in range (0,5):
    print (x**2)

No comments:

Post a Comment