How to Get Input from User in Python
Today we’re going to see how to get input from user in Python.
Table of Contents
Input String
We use input()
function in Python to get user input.
main.py
var = input("Enter any string: ")
print(var)
Input Integer
We can take only integer input using int(input())
.
var = int(input("Enter an Integer: "))
print(var)
Input Float
We can take only integer input using float(input())
.
var = float(input("Enter a float value: "))
print(var)
That’s it. Thanks for reading. ?

Md Obydullah
https://shouts.dev/obydul
Comments
No comments yet…