Senior citizen check

EasyIf-Else Programs · 60 of 64

Write a Python program to check whether a person is a senior citizen (age greater than 60).

Advertisement
Input
70, 45
Output
70 -> senior citizen
45 -> not a senior citizen

Approach

  1. Compare the age with 60.

Solution

Python
for age in [70, 45]:    if age > 60:        print(age, "-> senior citizen")    else:        print(age, "-> not a senior citizen")
Output
70 -> senior citizen
45 -> not a senior citizen
Advertisement

Learn the concept

New to this topic? Read the lesson, then come back.

More if-else programs

← All 64 If-Else Programs