May-30-2020, 05:42 PM
Hi members, i am new here and I have so many requests in phyton to learn... Please help me... i write a code like this but not working
if i enter 4 , it says is an odd number... (this is false)
if i enter 5, it says is an odd number...
if i enter a, it says is not a number...
how do i fix it?
num = input("Please enter a number: ") if num.isalpha(): print(f"{num} is not a number.") elif type(num) == int and (num %2) == 0: #If the value entered is a number and divided by two, print(f"{num} çift sayıdır") #say it as an even number else: print(f"{num} is an odd number")why this code not working...
if i enter 4 , it says is an odd number... (this is false)
if i enter 5, it says is an odd number...
if i enter a, it says is not a number...
how do i fix it?