How can I make this program stop if it recognises the input is a letter and not a number | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How can I make this program stop if it recognises the input is a letter and not a number

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

12th Jul 2018, 5:17 AM
Raphael Shay
Raphael Shay - avatar
3 Answers
+ 6
Raphael Shay #edit try: check = int(input()) print("Is a number") except(ValueError): print("Not a number")
12th Jul 2018, 5:25 AM
Manual
Manual - avatar
12th Jul 2018, 5:32 AM
Manual
Manual - avatar
+ 1
Thanks!
12th Jul 2018, 5:28 AM
Raphael Shay
Raphael Shay - avatar