Sunday, April 20, 2025

Python Keyboard Input

It's extremely easy to grab input from the keyboard in Python:


print("Your First App v0.00001")
print("-----------------------")

x = input("Please, enter your name: ")
print("Name: ", x)

We can do some immediate calculations:


print("Your First App v0.00001")
print("-----------------------")

x = int(input("Please, enter some number: "))
print("Result: ", x + x)

And sure, use as much inputs as you need:


print("Your First App v0.00001")
print("-----------------------")

x = (input("Please, enter your Name: "))
y = (input("Please, enter your LastName: "))

print(x, y)

In next tutorial we will work with Lists. They are just collections of elements enclosed in brackets.

No comments:

Post a Comment

Tkinter Introduction - Top Widget, Method, Button

First, let's make shure that our tkinter module is working ok with simple  for loop that will spawn 5 instances of blank Tk window .  ...