CBSE Class 11 Informatics Practices Question 89 of 102

Python Programming Fundamentals — Question 50

Back to all questions
50
Question

Question 37

Write a program to read details like name, class, age of a student and then print the details, firstly in the same line and then in separate lines.

Solution
name = input("Enter name of student: ")
c = int(input("Enter class of student: "))
age = int(input("Enter age of student: "))
print("Name:", name, "Class:", c, "Age:", age)
print()
print("Name:", name)
print("Class:", c)
print("Age:", age)
Output
Enter name of student: Kavya
Enter class of student: 9
Enter age of student: 14
Name: Kavya Class: 9 Age: 14

Name: Kavya
Class: 9
Age: 14
Answer