Nested if else statements Python

PHOTO EMBED

Fri Sep 01 2023 10:02:42 GMT+0000 (Coordinated Universal Time)

Saved by @pythonHub #python #python-hub #basics

num = -19

if num>=0:
    if type(num)==float:
        print(f"{num} is a positive floating-point number.")
    elif type(num)==int:
        print(f"{num} is a positive integer.")

else:
    if type(num)==float:
        print(f"{num} is a negative floating-point number.")
    elif type(num)==int:
        print(f"{num} is a negative integer.")
content_copyCOPY