+ 1

How to execute this program multiple times?how to know every info in one time execution?

# Write your code print ("what do u want to know about u?") print ("name,age,height,fav_number,fav_chocolate,fav_heroine,fav_food,lover_name,fav_colour,fav_flavour") x=input ("info u want to know\n") if x=="age": print("20") if x=="name": print("jaanu") if x=="fav_colour": print("pink") if x=="fav_flavour": print("strawberry ") if x=="height": print("6 feet") if x=="fav_number": print("3") if x=="fav_chocolate": print("kit kat")

3rd May 2020, 6:55 PM
gousiya banoo
4 odpowiedzi
+ 5
Use loop
3rd May 2020, 7:01 PM
Bhavya
Bhavya - avatar
+ 2
Create looop.like while 1>0: ...your code
3rd May 2020, 7:01 PM
Vlad Jonson
Vlad Jonson - avatar
0
You need to use input(). Above you have a space in yours so it wont work. Then you need to see how you want that data structured. You can use a dictionary to map each key ('age', 'name', 'height') to the cooresponding value (20, 'Jaanu', '6 feet') You can then iterate through all the data and print what you want
3rd May 2020, 7:04 PM
Slick
Slick - avatar