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
Write a program to find area of a triangle.
Write a program to input a number and print its first five multiples.
Write a program to read three numbers in three variables and swap first two variables with the sums of first and second, second and third numbers respectively.
Write Python codes for the following statements:
(a) Assign value 10 to variable a.
(b) Assign value 10 to variables a, b and c.
(c) Assign value 20 to x and delete 5 from x and assign the variable x to y.