0

I want to exit programm after enter one name and one contactnumber but exit is not working will anyone solve this prblm??

https://code.sololearn.com/c4k3AhqMU0QM/?ref=app

25th Jul 2021, 2:31 PM
Kajal Kumari
3 Answers
0
Kajal Kumari Sololearn doens't support input one by one. You have to take input together with separate lines. So it is not possible like that.
25th Jul 2021, 3:24 PM
A͢J
A͢J - avatar
0
I have tried at pc also but not working
25th Jul 2021, 4:03 PM
Kajal Kumari
0
Kajal Kumari Doens't matter it is PC or Mobile. This code will not work in Sololearn playground. Btw you have you have taken same variable for both input so exit will work when you enter exit in 2nd input. Also if you have used "break" on condition (choice == 'exit') then no need to check while condition (choice != 'exit'), you can simply do: while True: #input1 #input2 #input3 if input3 == 'exit': break Try this: while True: choice1 = input("enter name of person \n") print("name is:" + choice1) choice2 = input("enter contactnumber of person \n") print("contactnumber:" + choice2) choice3 = input() if choice3 == 'exit': break Take input with separate lines like: AJ 9876543210 exit
25th Jul 2021, 4:24 PM
A͢J
A͢J - avatar