python-by-example-150-chall.../challenges69-79/challenge-075.py

11 lines
346 B
Python
Raw Normal View History

2019-07-20 21:01:50 +08:00
number_list = ['134', '762', '356']
for i in number_list:
print(i)
append_to_list = int(input('Enter number to add to list : '))
if append_to_list not in number_list:
print('This is not in the list')
number_list.append(append_to_list)
else:
print('This is in the list, could not add')
print(number_list.index(append_to_list))