Hello everyone. I have a problem with my code. I would like to directly display the value of an input() without using a variable
myList = ["Apple", "Banana", "Orange", "Lemon", Pineapple]
if input() in phone_book:
print(input())
else:
print("Not found")
In that case, the input() execute twice, instead of once.
I’d like to print the value of the input()
when this value is part of the list. But I don’t want to use a variable to do that.
How can we do that?