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
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)
# Get a number from the user
num = int(input("add: "))
# If the number was 1- Larger, print it then
while num > -1:
print(num)
num -= 1
num = int(input('your number :'))# Receive number input from user while num > 0: pass print(num) pass num = num -1 # Reverse
number=int(input("your number:")) while True: if number>0: print(number) number=number-1
def print_countdown(number): while number >= 0: print(number) number -= 1 if number == -1: break print_countdown(number = int(input("Enter a number: ")))
Submitting answers is currently unavailable.
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام 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.