In this video, we learn how to collect input from the user in Python and how to handle input of different data types such as string, integer, and float.
Python's input() function collects user input as a string (str) by default. When we need a number, we can convert that input using functions such as int() and float().
Topics Covered
What is the input() function in Python?
How to collect text/string input
Using an input prompt
Collecting a user's name
Collecting integer input using int()
Collecting decimal/float input using float()
Why input() always returns a string
Converting string input into integer and float
Correct use of nested parentheses
Storing input in variables
Printing collected values
Example using student name, age, and marks
Understanding the complete input → conversion → variable process
Example
name = input("Give your name: ")
age = int(input("Give your age: "))
marks = float(input("Give your marks: "))
print(name, age, marks)
For example, if the user enters:
Rajesh Kumar, 18, 75.5
Python stores the name as a string, converts the age to an integer, and converts the marks to a float.
The key concept to remember is:
input() → String → Convert if required → Store in variable
This is one of the most commonly used techniques in beginner-level Python programs and forms the foundation for interactive Python applications.
👍 If you found this video useful, please Like, Share, and Subscribe to Computer Sir Ki Class for more Python tutorials.
#Python #PythonTutorial #PythonForBeginners #InputFunction #PythonInput #LearnPython #PythonBasics #PythonProgramming #DataTypes #ComputerSirKiClass
On this page of the site you can watch the video online Python User Input Explained | String, Integer & Float Input with a duration of hours minute second in good quality, which was uploaded by the user Computer Sir Ki Class 12 August 2026, share the link with friends and acquaintances, this video has already been watched 7 times on youtube and it was liked by 3 viewers. Enjoy your viewing!