So I'm trying to write this code which output 'accept' for some specific names the user inputs but it ain't working | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

So I'm trying to write this code which output 'accept' for some specific names the user inputs but it ain't working

x = input('enter your user ID:') if x==john: print('accept') elif x==lara: print('accept') elif x==jonah: print('accept') else: print('incorrect ID')

25th Aug 2019, 9:54 AM
Onimisi
Onimisi - avatar
2 Answers
+ 6
You forgot the "" at x== "theName"
25th Aug 2019, 9:56 AM
🍇 Alex Tușinean 💜
🍇 Alex Tușinean 💜 - avatar
0
Thanks it worked! I'm actually new Where i can get more examples of conditional statements like this?
25th Aug 2019, 10:06 AM
Onimisi
Onimisi - avatar