+ 2

Input in list python

how to assign variable to an input no. and how to put that in list[ ] for example user give a number and list goes that no. of index and print what is in it misc = list['lid',1,3,5,[6,5],0] input(i,) print('misc[i]')

28th Jan 2018, 3:46 AM
Mohibullah Bukhari
Mohibullah Bukhari - avatar
3 Answers
+ 2
this is just a sudeo code of it: input = input(“Input a number”) num = [] nun.append(“input”) input2 = input(“Do you want to access the list?”) if input2 == “Yes”: print(num) else: print(“List not accessed”)
28th Jan 2018, 2:50 AM
Ole113
Ole113 - avatar
0
thank you, but you missed my point, I added my code to give a concept what i am trying to do. I wanted user to input a number of index of list and display it.
28th Jan 2018, 3:48 AM
Mohibullah Bukhari
Mohibullah Bukhari - avatar
0
Ok sorry
28th Jan 2018, 4:02 AM
Ole113
Ole113 - avatar