Countdown
Write a program that receives a number of input and from that number to zero countdown and prints in the output
Write a program that receives a number of input and from that number to zero countdown and prints in the output
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
number=int(input("Enter a number :"))
if number > 0 :
for i in range(-1 , number):
print(number)
number = number - 1
else:
print("Enter a positive number not 0 or a negative number.")
num = int(input("enter a number and its inverse will go to zero:"))
while num > 0:
print (num)
num = num - 1
def countdown():
# Get a number from the user
number = int(input("لطفاً یک عدد وارد کنید: "))
# Countdown from the number entered to zero
for i in range(number, -1, -1):
print(i)
# Implementation of the function
countdown()
num = int(input("your number : "))
def max(num):
while True:
if num == -1:
break
else:
print(num)
num -= 1
max(num)
num = int(input("Enter your number: "))
for i in range(num):
print(num)
num = num -1
num = int(input("Num: "))
while num > -1:
print(num)
num -=1
print("\n")
adad=int(input("whats your adad: "))
while adad >= 0 :
print(adad)
adad=adad-1
Submitting answers is currently unavailable.
You must be logged in to access this section.
Login/Sign up If you don’t understand the exercise or can’t solve it for any reason, that’s completely
normal—don’t worry 😊
Try checking out easier exercises and reviewing different answers
submitted by others. Gradually, you can move on to more challenging exercises. Also, your answer
might be correct even if it’s different from others.