Firstsecprogrampython
Firstsecprogrampython
py
Develop a program to read the student details like Name, USN, and Marks in three subjects.
Display the student details, total marks and percentage with suitable messages.
stName = input("Enter the name of the student : ")
stUSN = input("Enter the USN of the student : ")
stMarks1 = int(input("Enter marks in Subject 1 : "))
stMarks2 = int(input("Enter marks in Subject 2 : "))
stMarks3 = int(input("Enter marks in Subject 3 : "))
print("Student Details\n=========================")
print('Name :', stName)
print('USN :', stUSN)
print('Marks 1 :', stMarks1)
print('Marks 2 :', stMarks2)
print('Marks 3 :', stMarks3)
print('Total :', stMarks1+stMarks2+stMarks3)
print('Percent :',((stMarks1+stMarks2+stMarks3)/3))
print("=========================")
1.b Senior Citizen Check
ChkSnrCitzn.py
Develop a program to read the name and year of birth of a person. Display whether the
person is a senior citizen or not.
from datetime import date
perName = input("Enter the name of the person : ")
perDOB = int(input("Enter his year of birth : "))
curYear = date.today().year
perAge = curYear - perDOB
if (perAge > 60):
print(perName, "aged", perAge, "years is a Senior Citizen.")
else:
print(perName, "aged", perAge, "years is not a Senior Citizen.")