Skip to content

Joseph-T-Gordon

A complete log of all recent projects and skills

Menu
  • About me
  • Posts/Projects
  • Resume/Certifications
Menu

Post #35 (Python Programming) – The input() function

Posted on March 18, 2023June 26, 2023 by admin

While print() is used to display data from the console, the input function accepts data from the console. You can set the input to a variable and use it in your code. You can also convert your input into a different data type by default it is a string str() but you can change it via int(), float(), etc.

code:

var = input(“Please enter your input here: “)

print(var*5)

result:

Please enter your input here

>>> 1

11111

code:

var = int(input(“Please enter your input here: “))

print(var*5)

result:

Please enter your input here:

>>> 1

5

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

© 2025 Joseph-T-Gordon | Powered by Minimalist Blog WordPress Theme