0

pls sololearn fix this

sololearn can you please fix the input system in the code bits. And when I tried to do a countdown in python but, sleep() system is not working. So can you pls fix it

14th Nov 2024, 12:50 AM
LuckiGuy
LuckiGuy - avatar
6 odpowiedzi
+ 8
You have to give all your input at once in a pop up box, and yes sleep() doesn't work on Sololearn compiler. Give a suggestion feedback to Sololearn via info@sololearn.com.
14th Nov 2024, 1:16 AM
Gulshan Mahawar
Gulshan Mahawar - avatar
+ 8
LuckiGuy / Gulshan Mahawar sleep() does work just not in the Python playground Using python skulpt module in web playground it is possible and works. Example: https://sololearn.com/compiler-playground/Wjo2ZOjvNjN8/?ref=app
14th Nov 2024, 2:06 AM
BroFar
BroFar - avatar
+ 6
Yes, Ausgrindtube you're right 👍. LuckiGuy Actually the sleep() work in python, but the problem is that it execute all the print statements at once. For example:- import time for i in range(5): time.sleep(1) print(i) In the above code, time.sleep(1) will be execute 5 times. So, it will output all the numbers after 5 seconds. Also when you try to use bigger value in sleep() i.e more than 5, it will say 'no output' because there is a time limit or timeout for a code execution . And use web playground using skulpt as BroFar Sir mentioned for better output.
14th Nov 2024, 9:27 AM
Gulshan Mahawar
Gulshan Mahawar - avatar
+ 5
LuckiGuy I just explained that it doesn't work in the Python playground but it does work in the Web playground Look at the textarea where the Python code ( script ) is... import time def countdown(seconds): while seconds > 0: print(seconds) time.sleep(seconds) seconds -= 1 print("Time's up!") countdown(15)
14th Nov 2024, 3:23 AM
BroFar
BroFar - avatar
+ 3
It doesnt work in python though. It says "no output."
14th Nov 2024, 3:18 AM
LuckiGuy
LuckiGuy - avatar
+ 3
It does work, doesn't it? It just delays the output until the end, instead of in real-time.
14th Nov 2024, 7:43 AM
Ausgrindtube
Ausgrindtube - avatar