5 Comments

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")

Expand full comment

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()

Expand full comment

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()

Expand full comment

number=int(input('Enter number: '))

if number > 0:

print('number positive')

elif number < 0:

print('number negative')

else:

print('zero')

Expand full comment

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()

Expand full comment