-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFavListColor.py
More file actions
38 lines (29 loc) · 1.01 KB
/
FavListColor.py
File metadata and controls
38 lines (29 loc) · 1.01 KB
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
'''
1. Create 2 lists
a) input name store in one list
b) Input favorite color store in second list
2. Type Q to quit
3. Print each name with corresponding Favorite color
'''
def main():
getNameFavColor()
def getNameFavColor():
continueProgram = True
nameList = []
colorList = []
while(continueProgram==True):
firstName=str(input("Enter your first name:"))
nameList.append(firstName)
favColor=str(input("Enter your favorite color:"))
colorList.append(favColor)
lengthofNameList=len(nameList)
count=0
for count in range(0, lengthofNameList):
print("Hello there!")
print(nameList[count],", your favorite color is",colorList[count])
print("That's fantastic!")
wantToContinue=str(input("-----Press Q if you want to quit, all other input continues:"))
wantToContinue = wantToContinue.strip()
if wantToContinue == "Q" or wantToContinue == "q":
continueProgram = False
main()