Write a Program to ask the Student Name and Roll Number

Avanish Tiwari
2 min readFeb 3, 2021

Write a Program to ask the Student Name and Roll Number:-

I think you are starting to learn Python and it is good thing to see that you are practicing so I’ll help you in solving your problem so Let’s start.

To ask the Student name and Roll Number we have to learn that how to take input in Python. After the taking input save the information in a variable. To display the information of student we have to access the variables and print them.

so we will solve all problems step by step so my first step will be-

How to take input in the Python?:-

To take input, there is one function input and it’s correct syntax is input(prompt) here prompt means default message before the take input.

and second step will be :-

How to save a element into variable in Python?:-

As everyone knows that taking a variable in Python is very easy because you have not to clear the data type it will take automatically according to the entered value so have simply take a variable and assign to the input value.

and last step will be :-

How to display the information in Python?:-

To Display or you can say print any message in Python is very easy and it can done by the using print function in the Python. Syntax of the print function is print(object(s), sep=separator, end=end, file=file, flush=flush) .

So we are moving to code right now.

Code:-

Related Queries:-

Python program that stores the student name, roll number, and marks in three subjects ?

write a python program that prints (displays) your name, address, and telephone number.

Python Program for the Student Information.

--

--