KnowledgeBoat Logo
|

Informatics Practices

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.

Python Funda

2 Likes

Answer

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

Answered By

1 Like


Related Questions