-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflow.py
39 lines (35 loc) · 903 Bytes
/
flow.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
''' program flow
string formatiing https://docs.python.org/2/library/string.html#formatspec
'''
age = input("my age: ")
if age > 24 and not age >30:
print("age is greater than 24")
b=age + 7
print(b)
if age < 24:
print(" you are still young")
else:
print("you are old")
name = raw_input("my name :")
if name == "allan" and age > 24:
print("hi "+ name)
elif name=="mary":
print("hi mary")
else:
print("you are not allan or mary")
i =0;
while i <3:
print "counting to 3 from %d "%i
print "counting to 3 from ,i"
print "counting to 3 from" + str(i)
print "counting to 3 from {0}".format(i)
i=i+1
#break and continue statements
while True:
print("please type your name")
user = input()
if user == name:
print("thank you %s" %user)
break
else:
print("Your name is "+ name +" are you a new user");