How to show only the last result? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to show only the last result?

print("welcom") x=int(input("bacteri= ")) min=int(input("minute= " )) c=20 while min>=20: if c<=min: x**=2 c=c+20 print(x)

13th Sep 2021, 9:43 AM
Motahareh
4 Answers
+ 7
print("welcom") x=int(input("bacteri= ")) min=int(input("minute= " )) c=20 while min>=20: if c<=min: x**=2 c=c+20 print(x) make the list line outside of the loop ✔️
13th Sep 2021, 9:53 AM
Moha Riad
Moha Riad - avatar
+ 2
print("welcom") x=int(input("bacteri=\n")) min=int(input("minute=\n " )) c=20 while min>=20: if c<=min: x**=2 c+=20 print(x)
14th Sep 2021, 5:57 PM
CGO!
CGO! - avatar
0
This code does not show any results
13th Sep 2021, 10:10 AM
Motahareh
0
Hi Motahareh! Here, you used input variable min in while condition and you didn't make any changes to increase or decrease it. That's why it prints nothing. Can you tell us what you're trying to print as output? It's better to share it here if you have any expected output for particular input.
13th Sep 2021, 11:51 AM
Python Learner
Python Learner - avatar