Integer Numbers | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Integer Numbers

Write a program that repeatedly prompts a user for integer numbers until the user enters 'done'. Once 'done' is entered, print out the largest and smallest of the numbers. If the user enters anything other than a valid number catch it with a try/except and put out an appropriate message and ignore the number. Enter 7, 2, bob, 10, and 4 and match the output below. https://code.sololearn.com/c5z6jqSuEWJ7/?ref=app

4th Jun 2020, 1:48 PM
Moye Nkem Onyeka
Moye Nkem Onyeka - avatar
6 Answers
+ 7
Moye Nkem Onyeka try this, but it won't work on sololearn playground, unless you put every input on one line (and all inputs are integers) at a time and 'done' on the last line as final input. you can try it in pycharm. if the number is not integer (apart from float which will be transformed to integer without rounding up to the higher value) it will print the text 'please enter integer num' and you can continue with the inputs https://code.sololearn.com/cp44Eioc8aoS/?ref=app
4th Jun 2020, 3:32 PM
Sebastian Pacurar
Sebastian Pacurar - avatar
+ 7
Nwannem, check out my solution here. Type in your inputs separating them on different line using tab key. That's how the code playground works. Good luck. https://code.sololearn.com/cDlzAGFjojTF/?ref=app
4th Jun 2020, 3:52 PM
👑 Tchybooxuur!
👑 Tchybooxuur! - avatar
+ 2
Move the code link from thread title to the Description field. Links don't work if you put them in title or tags. And please specify a relevant language in the thread tags instead 👍
4th Jun 2020, 2:49 PM
Ipang
+ 2
Ipang ? It now on description, please confirm this.
4th Jun 2020, 2:51 PM
Moye Nkem Onyeka
Moye Nkem Onyeka - avatar
+ 1
I can see it, ok good luck with solution 👍
4th Jun 2020, 3:00 PM
Ipang
+ 1
I await solutions ooh
4th Jun 2020, 3:01 PM
Moye Nkem Onyeka
Moye Nkem Onyeka - avatar