num = int(input("Enter a number: "))
if num % 2 == 0:
print("Even")
else:
print("Odd")
Output:Enter a number: 5
Odd
a = 50
b = 70
if a > b:
print("Largest:", a)
else:
print("Largest:", b)
Output:Largest:70
num = int(input("Enter a number: "))
if num > 0:
print("Positive")
elif num < 0:
print("Negative")
else:
print("Zero")
Output:Enter a number: -5
Negative
age = int(input("Enter your age: "))
if age >= 18:
print("Eligible to vote")
else:
print("Not eligible to vote")
Output:Enter your age: 21
Eligible to vote
year = int(input("Enter a year: "))
if (year % 4 == 0):
print("Leap Year")
else:
print("Not a Leap Year")
Output:Enter a year: 2013
Not a Leap Year
ch = input("Enter a character: ")
if ch in "aeiouAEIOU":
print("Vowel")
else:
print("Consonant")
Output:Enter a character: k
Consonant
age = int(input("Enter your age: "))
if age < 13:
print("Child")
elif age < 20:
print("Teenager")
else:
print("Adult")
Output:Enter your age: 4
Child
day = int(input("Enter day number (1-7): "))
if day == 1:
print("Monday")
elif day == 2:
print("Tuesday")
elif day == 3:
print("Wednesday")
elif day == 4:
print("Thursday")
elif day == 5:
print("Friday")
elif day == 6:
print("Saturday")
elif day == 7:
print("Sunday")
else:
print("Invalid day number")
Output:Enter day number (1-7): 9
Invalid day number
score=int(input("Enter a score:"))
if(score>75):
print("Good Student")
elif(score>35 & score<75):
print("Average Student")
else:
print("Poor Student")
Output:Enter a score:70
Average Student
Enter a score:12
Average Student
Poor Student
score=int(input("Score Percentage:"))
if(score>=70):
name=input("name:")
department=input("department:")
location=input("location:")
print("you are eligible")
else:
print("you are not eligible")
Output:Score Percentage:99
name:kiruthiga
department:CSE
location:Chennai
you are eligible
Top comments (0)