We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b5674e8 commit 9bab11eCopy full SHA for 9bab11e
1 file changed
08. userinputs & while loops/4. userinput_&_dictionary.py
@@ -6,3 +6,19 @@
6
# Set a flag to indicate that polling is active.
7
flag = True
8
9
+while flag:
10
+ name = input("\nplease enter your name: ")
11
+ fav_lang = input("\nplease enter your fav programming language: ")
12
+ languages[name] = fav_lang
13
+
14
+ another_poll = input("\ndo you want to take another poll. type 'yes/no': ")
15
+ if another_poll == 'no':
16
+ flag = False
17
18
19
+print(f"\npoll info are as follows:")
20
+for key,val in languages.items():
21
+ print(f"\t{key} : {val}")
22
23
+#* The program first defines an empty dictionary (responses) and sets a flag (polling_active) to indicate that polling is active.
24
+# As long as polling_active is True, Python will run the code in the while loop
0 commit comments