Jump to content
Begedeu

Ajutor problema banala python

Recommended Posts

Salut , va rog frumos sa ma ajutati la urmatoarea problema .

Outputul trebuie sa fie acesta .

Countdown timer: How many
seconds? 4
4 * * * *
3 * * *
2 * *
1 *
BLAST OFF!

Nu stiu cum sa fac cu stelutele.

Cel mai mult imi displac for-urile .

import time
asd=int(input("Cate secunde: "))
for i in range (asd,0,-1):
for j in range (asd,0,-1):
print("*",end='')
print(i)
time.sleep(1)
print("Done")

Sunt sigur ca ori mai trebuie un for , ori trebuie sa modific ceva la al doilea, dar nu stiu ce.

Link to comment
Share on other sites

uite si cu while

import time

steluta = "*"
print("Countdown Timer")
secunde = int(input("How many seconds?: "))
while secunde >= 1:
print(secunde, steluta * secunde)
secunde -= 1
time.sleep(1)
print("BLAST OFF!")

si eu is incepator in python. daca vrei dami id tau prin pm si mai vorbim unu cu altu..

ii alta treaba cand mai ai cu cine vorbi.

Edited by Slark
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...