-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path11-While.py
63 lines (44 loc) · 1.32 KB
/
11-While.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Sample while
# count = 1
# while count <= 10:
# print(count)
# count += 1 # count = count +1
# count = 1
# while (count != 10)
# count+=1:
# print(count)
# Poem
prompt = "Write a poem! \n"
prompt += "Enter 'Quit' or 'quit' to End \n"
poem = ""
line = ""
while line != 'Quit' and line != 'quit':
line = input(prompt)
if line == 'Quit':
break
elif line == 'quit':
break
poem += line # poem = poem + line ,(Here line stored in the poem becoz line empty ah irruthathain next while loop run panna mudiuim
poem += '\n' # It's mention the new line of the poem
# print(poem.replace('Quit' and 'quit', ''))
print(poem)
# Month
# Break
# Continue
# month = int(input("Enter your month"))
# day = 1
# while day <= 31:
# if month == 2 and day > 28:
# break
# elif (month == 4 or month == 6 or month == 9 or month == 11) and day > 30:
# # day +=1
# break
# print(day)
# day += 1
# While in List
# Sports =['Football', 'Volleyball', 'Handball', 'Throwball', 'Football', 'Handball', 'Handball']
# #print(Sports)
# while 'Handball' in Sports:
# Sports.remove('Handball')
#
# print(Sports)