+ 1
Write a script in python
Write some lines of code so ask a number between 1 to 10 from user. If user enters the number in first attempt, print that number if it doesn't enter number in first time give him 3 chances to enter the number between 1 to 10. After 3 chances he doesn't enter the number... Exit the program.
7 Answers
+ 4
Somewhat easy
+ 2
Here is my number guess.
It works for numbers 1-100 and you have 10 tries. It also has a scoring.
It only works in Python IDLE, because it needs input at different time so you won't be able to run it in Code Playground.
https://code.sololearn.com/caXXNb7S4WQ2/?ref=app
+ 2
I don't think that exactly such code can be run at sololearn as it takes input just once.
+ 2
@Lakshay: code playground is not the only way to run Python script ;) It could be useful used to write/store/share Python script to be executed in other contexts (user desktop interpreter, or mobile apps as QPython for android) ^^
@Tim Thuma: do searches in code playground list, filtering only Python scripts (or not): you would find tons of guess number games ;)
0
Please write the code
0
Thanks vengat for the code... But program shouldn't terminate until user receive 3 chances to enter the number between 1 to 10