WRITE A PROGRAM TO READ DETAILS LIKE NAME, CLASS , AGE OF A STUDENT AND THEN PRINT THE DETAILS FIRSTLY IN SAME LINE AND THEN IN SEPERATE LINES. In python language..
Answers
Program:
name,class,age = input("Enter Student name : "),input("Enter student class : "),int(input("Enter student's age : "))
print("Student name : ",name,"-Student class : ",class,"-Student age : ",age)
print("Student name",name,"\nStudent class : ",class,"\nStudent age : ",age)
Output:
Enter Student name : student1
Enter student class : 10th
Enter student's age : 15
Student name :student1-Student class : 10th-Student age : 15
Student name :student1
Student class : 10th
Student age : 15
Explanation:
- in print you can use "," to separate variables from the printing statements and you can use escape sequence like "\n" or "\t" and so on like that
- so using that i printed in one line and in multiple lines.
-----Hope you got what you wanted,if you liked my program mark as brainliest,it would really help me. :)
Program:
Name=input("Enter Name:")
Class=input("Enter Class:") #class is a keyword whereas Class isn't. Age=int(input("Enter Age:"))
print(Name,Class,Age)
print("\n")
print(Name)
print(Class)
print(Age)
Output:
Enter Name:venu
Enter Class:9
Enter Age:15
venu
9
15