0% found this document useful (0 votes)
96 views2 pages

Firstsecprogrampython

The document contains code for two Python programs. The first program reads a student's name, USN, and marks in three subjects, calculates total marks and percentage, and displays the results. The second program reads a person's name and year of birth, calculates their current age, and prints whether they are a senior citizen (over 60) or not.

Uploaded by

ambika400
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views2 pages

Firstsecprogrampython

The document contains code for two Python programs. The first program reads a student's name, USN, and marks in three subjects, calculates total marks and percentage, and displays the results. The second program reads a person's name and year of birth, calculates their current age, and prints whether they are a senior citizen (over 60) or not.

Uploaded by

ambika400
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

1.a StudDetails.

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.")

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy