Write a Python program that reads a student name, his/her age, and his/her height (in feet) from the console and prints out all pieces of data related to a student, i.e. name, age, and height, in one line of the output console.
Example of output: John Smith 30 5.9

Respuesta :

Answer:

The program to this question as follows:

Program:

name = input("Student Name: ")#defining variable name

age = int(input("Student Age: "))#defining variable age

height = float(input("Height (in feet): "))#defining variable height

print(name + " " + str(age) + " "+ str(height))#print values in one line.

Output:

Student Name: John Smith

Student Age: 30

Height (in feet): 5.9

John Smith 30 5.9

Explanation:

In the above python program, three variable name, age, and height is declared, in these variables the input function is used, that takes input from the user sides on console screen, and in the next line, the print function is declared, that uses these three variables for printing their holding values in the single line.

ACCESS MORE
EDU ACCESS