hi, What is this program and why this code does not work? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

hi, What is this program and why this code does not work?

total=0 price=0 l=0 while l<3: l=l+1 x = input() z = int (x) if z <3: price=0 if z>=3: price=100 total+=price #price+=100 print(total) https://sololearn.com/coach/1039/?ref=app

23rd Oct 2021, 5:48 AM
Hakam ALdeen ALkhadraa
Hakam ALdeen ALkhadraa - avatar
8 Answers
+ 3
Hi Hakam! You're supposed to take 5 inputs here. But, your code just takes first 3 inputs because of your while condition. It needs to be like this while l<5:
23rd Oct 2021, 6:36 AM
Python Learner
Python Learner - avatar
+ 2
JUMP_LINK__&&__Python__&&__JUMP_LINK Learner thank you very much... i did not pay attention
23rd Oct 2021, 6:43 AM
Hakam ALdeen ALkhadraa
Hakam ALdeen ALkhadraa - avatar
+ 1
Hakam ALdeen ALkhadraa This code is Python and it does work
23rd Oct 2021, 5:55 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 1
Rik Wittkopp Yes, but why do not they give me correct results in testing ... I've been checking twice a correct introduction and two securities you can check when accessing the link and seeing results
23rd Oct 2021, 5:58 AM
Hakam ALdeen ALkhadraa
Hakam ALdeen ALkhadraa - avatar
+ 1
Hakam ALdeen ALkhadraa The challenge is a Pro challenge so only available to Pro users. This means you must publish the challenge details here, or seek the assistance of a Solo-helper
23rd Oct 2021, 6:05 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 1
Rik Wittkopp Thank you I hope we will arrive for this
23rd Oct 2021, 6:05 AM
Hakam ALdeen ALkhadraa
Hakam ALdeen ALkhadraa - avatar
0
Hakam ALdeen ALkhadraa I will try to access the challenge to look.
23rd Oct 2021, 6:02 AM
Rik Wittkopp
Rik Wittkopp - avatar
- 1
Why I didn't make responsive website
25th Oct 2021, 3:35 AM
Mr Ali
Mr Ali - avatar