Python If Else Examples

Python

Conditional Statements ( If – Else )

 

  1. Check whether the number is positive or negative
    num = int(input(“Enter a number: “))
    if num >= 0:
    print(“The number is positive”)
    else:
    print(“The number is negative”)

 

  1. Check Whether the number is Odd or Even
    num = int(input(“Enter a number: “))
    if num % 2 == 0:
        print(“Even number”)
    else:
        print(“Odd number”)

 

  1. Check if a person is eligible to vote
    age = int(input(“Enter your age: “))
    if age >= 18:
        print(“You are eligible to vote”)
    else:
        print(“You are not eligible to vote”)

 

  1. Find the greatest of two numbers
    a = int(input(“Enter first number: “))
    b = int(input(“Enter second number: “))
    if a > b:
        print(“First number is greater”)
    else:
        print(“Second number is greater or equal”)

 

  1. Check if a number is divisible by 5
    num = int(input(“Enter a number: “))
    if num % 5 == 0:
        print(“The number is divisible by 5”)
    else:
        print(“The number is not divisible by 5”)

 

  1. Check whether a year is a leap year
    year = int(input(“Enter a year: “))
    if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):
        print(“Leap year”)
    else:
       print(“Not a leap year”)

 

  1. Check if a character is a vowel or consonant
    ch = input(“Enter a character: “).lower()
    if ch in ‘aeiou’:
        print(“Vowel”)
    else:
        print(“Consonant”)

 

  1. Simple grading system
    marks = int(input(“Enter marks: “))
    if marks >= 90:
        print(“Grade A”)
    elif marks >= 75:
        print(“Grade B”)
    elif marks >= 50:
        print(“Grade C”)
    else:
        print(“Grade D”)

 

  1. Check if a triangle is valid
    a = int(input(“Enter first side: “))
    b = int(input(“Enter second side: “))
    c = int(input(“Enter third side: “))
    if a + b > c and b + c > a and c + a > b:
        print(“Valid triangle”)
    else:
        print(“Invalid triangle”)

 

  1. Check whether the entered character is uppercase or lowercase
    ch = input(“Enter a character: “)
    if ch.isupper():
        print(“Uppercase letter”)
    elif ch.islower():
        print(“Lowercase letter”)
    else:
        print(“Not an alphabet letter”)

 

Current Affairs 2025 MCQs

Class 5 Cleanliness, Health and Hygiene MCQ

Class 5 Cleanliness, health and hygiene worksheet

Class 9 Fundamental Unit of Life MCQ

Class 9 Matter in our Surrounding MCQ

Class 4 Adaptations in Animals Online MCQs Test

Practice Test - 2

Class 4 Adaptions in animals MCQ online test

Practice Test - 1

Adaptations in Animals Class – 4 MCQ

Class – 4

Adaptations in Animals

Multiple Choice Questions

Practice Worksheet

  1. Animals that live on land are called:
    a) Aquatic animals
    b) Terrestrial animals
    c) Arboreal animals
    d) Amphibians

  2. What helps camels walk on sand without sinking?
    a) Long legs
    b) Thick skin
    c) Padded feet
    d) Humps

  3. Which animal has blubber to keep warm in polar regions?
    a) Camel
    b) Frog
    c) Polar bear
    d) Duck

  4. The ability of animals to sleep during winter is called:
    a) Migration
    b) Camouflage
    c) Adaptation
    d) Hibernation

  5. Animals that breathe through gills and live in water are:
    a) Amphibians
    b) Terrestrial animals
    c) Aquatic animals
    d) Arboreal animals

  6. Ducks swim in water with the help of:
    a) Fins
    b) Webbed feet
    c) Flippers
    d) Tails

  7. Animals that can live both on land and in water are:
    a) Aquatic animals
    b) Aerial animals
    c) Arboreal animals
    d) Amphibians

  8. Monkeys swing from trees with the help of their:
    a) Wings
    b) Sharp claws
    c) Tails and legs
    d) Fins

  9. Birds can fly easily because of their:
    a) Thick bones
    b) Heavy body
    c) Streamlined body and hollow bones
    d) Large teeth

  10. Which animal changes its colour to blend with surroundings?
    a) Zebra
    b) Chameleon
    c) Monkey
    d) Cow

  11. What is the purpose of camouflage?
    a) To store food
    b) To scare predators
    c) To blend in with surroundings
    d) To attract mates

  12. Animals that eat only plants are called:
    a) Carnivores
    b) Herbivores
    c) Omnivores
    d) Parasites

  13. Which animal uses its trunk to break tree branches?
    a) Lion
    b) Giraffe
    c) Elephant
    d) Bear

  14. Which of these is an example of an omnivore?
    a) Lion
    b) Cow
    c) Crow
    d) Leopard

  15. What helps a giraffe reach leaves on tall trees?
    a) Sharp teeth
    b) Long tail
    c) Long neck
    d) Big ears

  16. Aerial animals spend most of their time:
    a) In water
    b) Underground
    c) In air
    d) On land

  17. What kind of teeth do carnivores have?
    a) Flat
    b) Long and pointed
    c) No teeth
    d) Blunt

  18. Which animals live in trees?
    a) Arboreal animals
    b) Aerial animals
    c) Aquatic animals
    d) Amphibians

  19. Which body part helps birds change direction while flying?
    a) Wings
    b) Tail
    c) Feet
    d) Beak

  20. Which of the following is a parasite?
    a) Snake
    b) Lion
    c) Lice
    d) Frog

  21. The body of a polar bear is suited to:
    a) Eat grass
    b) Climb trees
    c) Survive extreme cold
    d) Fly in the sky

  22. What are animals called that feed on dead remains?
    a) Omnivores
    b) Carnivores
    c) Scavengers
    d) Parasites

  23. Which of these is an endangered animal?
    a) Polar bear
    b) Dog
    c) Cow
    d) Hen

  24. What does a butterfly use to suck nectar?
    a) Claws
    b) Beak
    c) Straw-like mouth
    d) Tongue

  25. Which of the following help the whale to protect itself in cold temperature?
    a) Long Tail
    b) Thick Fur
    c) A hump
    d) A thick layer of fat

 

 

 

 

 

 

 

 

 

 

Answer Key

  1. b) Terrestrial animals

  2. c) Padded feet

  3. c) Polar bear

  4. d) Hibernation

  5. c) Aquatic animals

  6. b) Webbed feet

  7. d) Amphibians

  8. c) Tails and legs

  9. c) Streamlined body and hollow bones

  10. b) Chameleon

  11. c) To blend in with surroundings

  12. b) Herbivores

  13. c) Elephant

  14. c) Crow

  15. c) Long neck

  16. c) In air

  17. b) Long and pointed

  18. a) Arboreal animals

  19. b) Tail

  20. c) Lice

  21. c) Survive extreme cold

  22. c) Scavengers

  23. a) Polar bear

  24. c) Straw-like mouth

  25. d) A thick layer of fat