Objective: Write a program to display students’ details.
# Student Details Program without using functions
# Input details for three students
student1_name = input("Enter name of student 1: ")
student1_age = int(input("Enter age of student 1: "))
student1_grade = input("Enter grade of student 1: ")
student2_name = input("\nEnter name of student 2: ")
student2_age = int(input("Enter age of student 2: "))
student2_grade = input("Enter grade of student 2: ")
student3_name = input("\nEnter name of student 3: ")
student3_age = int(input("Enter age of student 3: "))
student3_grade = input("Enter grade of student 3: ")
# Displaying student details
print("\nStudent Details:")
print(f"Student 1 - Name: {student1_name}, Age: {student1_age}, Grade: {student1_grade}")
print(f"Student 2 - Name: {student2_name}, Age: {student2_age}, Grade: {student2_grade}")
print(f"Student 3 - Name: {student3_name}, Age: {student3_age}, Grade: {student3_grade}")
No comments:
Post a Comment