Please I am stuck at Time's up | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Please I am stuck at Time's up

3rd Nov 2023, 11:19 AM
Prosper Jacob
Prosper Jacob - avatar
18 Answers
+ 6
show your code. mention course name.
3rd Nov 2023, 12:19 PM
Lisa
Lisa - avatar
+ 6
Prosper Jacob your post seems to be incomplete. it should include: > the programming language (to be placed in tags) > if your post is related to a sololearn tutorial, we need to know the name of it, also the module and lesson /exercise name. > a clear task description with input / output sample > a link that points to your code try > a description what exactly your issue is, (if possible including an error message) info: time's up! is an exercise in the *introduction to python* tutorial, control flow (module 4).
3rd Nov 2023, 3:36 PM
Lothar
Lothar - avatar
+ 4
The objective is to take a number as input and do a countdown. The given code is an infinite loop because the variable 'number' never changes. You need that variable to decrease within the loop until the condition of the while loop is met. Here is a working example: https://code.sololearn.com/cazFTTMD7ESw/?ref=app
4th Nov 2023, 10:15 AM
Keith
Keith - avatar
+ 4
Prosper Jacob , if there is still an issue, please link your current code here.
9th Nov 2023, 1:12 PM
Lothar
Lothar - avatar
+ 4
Prosper Jacob , there is an issue with indentation in the last line of your code. > decrementing of the value stored in variable `number` has to be done inside the while loop. correct this. > also the indentation you used in your code (1 space only), makes it difficult to read the code. the recommendation is to use 4 spaces per indentation level.
14th Nov 2023, 8:16 PM
Lothar
Lothar - avatar
+ 3
Prosper Jacob You should also post your attempt so that we can help you. Try to solve it and if you are still stuck use the share button in Code Playground to copy and paste the link here.
3rd Nov 2023, 8:19 PM
Keith
Keith - avatar
+ 2
pls show your code so that you can get better solutions
4th Nov 2023, 12:11 PM
Alhaaz
Alhaaz - avatar
+ 2
Prosper Jacob that is the code from the practice exercise. It results in an infinite loop. I explained the answer and posted a link to an example in my previous comment so take a look at that 👍
4th Nov 2023, 5:29 PM
Keith
Keith - avatar
+ 2
You must be typing something incorrectly because I just copy and pasted this exact code into the 'Time's Up' challenge in the Intro to Python course and it passed all 3 tests... Make sure your indenting everything correctly and if you still have any errors, let us know what the error says. The error should give you hints as to what is wrong.
6th Nov 2023, 9:06 PM
Keith
Keith - avatar
0
<Course title:Introduction to python> <Lesson:Time's up>
3rd Nov 2023, 5:42 PM
Prosper Jacob
Prosper Jacob - avatar
0
#Here’s part of the code: # take the number as input number = int(input()) #use a while loop for the countdown while number >= 0: print(number) #Now add the missing part so it’s not an infinte loop
3rd Nov 2023, 10:40 PM
Annihilate
Annihilate - avatar
0
While loop needs to be changes to > -1 And your counter is set to counter = counter - 1
4th Nov 2023, 2:03 PM
cspoon2@yahoo.com
cspoon2@yahoo.com - avatar
0
#or even this: counter-=1
4th Nov 2023, 5:09 PM
Annihilate
Annihilate - avatar
0
I wrote (while number >=1 Print(number)
4th Nov 2023, 5:22 PM
Prosper Jacob
Prosper Jacob - avatar
0
It has some little error
6th Nov 2023, 8:16 PM
Prosper Jacob
Prosper Jacob - avatar
0
It says the code is an infinite loop and the file too large
8th Nov 2023, 1:24 AM
Prosper Jacob
Prosper Jacob - avatar
0
take the number as input number = int(input()) #use a while loop for the countdown while number >= 0: print (number) number = number - 1
13th Nov 2023, 12:00 AM
Prosper Jacob
Prosper Jacob - avatar
0
Please can you teach me python
19th Nov 2023, 2:10 PM
Prosper Jacob
Prosper Jacob - avatar