Write a program to input names of n students and store them in a tuple. Also input a name from the user and find if this user is present in the tuple or not
Answers
Answered by
9
Answer:
values = input("Input some comma seprated numbers : ")
list = values.split(",")
tuple = tuple(list)
print('List : ',list)
print('Tuple : ',tuple)
Answered by
8
names = tuple([n for n in input("enter names: ").split()])
name = input("enter name: ")
print("present!") if name in names else print("not present!")
Similar questions
Science,
3 months ago
Math,
3 months ago
Computer Science,
11 months ago
Sociology,
11 months ago
Science,
11 months ago