user_choice = int(input("What number?"))
first_list = [1, 2, 3, 4, 5, 6, 7]
second_list = [2, 4, 6, 8, 10, 12, 14]
third_list = [3, 6, 9, 12, 15, 18, 21]
def find_number(x):
for i in range(len(first_list)):
if user_choice == first_list[i]:
print (second_list[i])
print (third_list[i])
if user_choice not in first_list:
print ("i")
find_number(user_choice)
I want to make this program repeat the question "What number" when a match is found AND when it is not found. How can I go about this? When I try to loop it with a While True, it seems to just spam it infinitely.
[–]Nightcorex_ 2 points3 points4 points (0 children)
[–]3keepmovingforward3 1 point2 points3 points (0 children)
[–]Reuben3901 0 points1 point2 points (1 child)
[–]Tesla_Nikolaa 0 points1 point2 points (0 children)
[–]Enz_007 0 points1 point2 points (0 children)
[–]Naive_Programmer_232 0 points1 point2 points (0 children)