Level 1: Beginner
print("nivel 1: principiante lunes, ejercicio 2")
print()
num = int(input("ingrese un numero: "))
if num > 0:
print("El numero es positivo.")
elif num < 0:
print("El numero es negativo.")
else:
print("El numero es cero")
def main() -> None:
num: int = int(input("Enter a number: "))
match num :
case num if num > 0 :
print("The number is positive")
case num if num < 0 :
print("The number is negative")
case _ :
print("The number is zero")
if __name__ == '__main__':
main()
num=int(input("ingresa el numero: "))
def numero():
if num>0:
print((f"el numero {num} es positivo"))
if num==0:
print((f"el numero {num} es igual a 0"))
elif num<0:
print((f"el numero {num} es negativo"))
numero()
number=int(input('Enter number: '))
if number > 0:
print('number positive')
elif number < 0:
print('number negative')
print('zero')
I have done. Here is my code
def check_number():
number = int(input("Enter a number: "))
print("The number is positive.")
print("The number is negative.")
print("The number is zero.")
check_number()
print("nivel 1: principiante lunes, ejercicio 2")
print()
num = int(input("ingrese un numero: "))
if num > 0:
print("El numero es positivo.")
elif num < 0:
print("El numero es negativo.")
else:
print("El numero es cero")
def main() -> None:
num: int = int(input("Enter a number: "))
match num :
case num if num > 0 :
print("The number is positive")
case num if num < 0 :
print("The number is negative")
case _ :
print("The number is zero")
if __name__ == '__main__':
main()
num=int(input("ingresa el numero: "))
def numero():
if num>0:
print((f"el numero {num} es positivo"))
if num==0:
print((f"el numero {num} es igual a 0"))
elif num<0:
print((f"el numero {num} es negativo"))
numero()
number=int(input('Enter number: '))
if number > 0:
print('number positive')
elif number < 0:
print('number negative')
else:
print('zero')
I have done. Here is my code
def check_number():
number = int(input("Enter a number: "))
if number > 0:
print("The number is positive.")
elif number < 0:
print("The number is negative.")
else:
print("The number is zero.")
check_number()