while-statement tag

3 questions


1 answers
147 views
0
[Python] I want to change the while statement to def.

I want to use the while statement below as a def function, what should I do? i = 0while True: i += 1 if i > 5: break print('*'*i)And I want to center the result value here. print({0:^30}('*'*i))...

2 years ago

1 answers
134 views
0
Strike an Angry Bird-like target with a Python turtleneck. Obtain collision conditions on the target.

I'm going to make something similar to the Angry Bird game with Python.So I made the codeimport turtle as timport mathimport randomt.shape(turtle)def square(): for i in range(4): t.forward(10) t.lef...


2 answers
133 views
0
[Python] Get the number of decimal places and print out the number of decimal places

Hi, everyone.I'm asking you a question because I didn't get it while studying Python.You want to receive a decimal number and print it out as many as you wrote in the title. I want to get an answer by...


© 2024 OneMinuteCode. All rights reserved.