Python for Beginners (1)
Python for Beginners by Apingfuturepro_thailand. Made since 9/8/2026. :)
- The Print
So, in Python, the print("") was used to output the text.
e.g. print("Hello world!") ---> Output: Hello world!
- The Datatype
There are many datatypes in Python, such as Int(integer), float(decimal), boolean(True or False), str(string), etc.
Look at these 2 examples
2.1) 123 2.2) "123"
These examples may look like the same datatype, but actually they don't!
Why?, because when you write "" in the left and right of the numbers, it will turn into the string.
When output: print(123) ---> Output: Nothing! print("123") ---> Output: 123
- The Operations
These symbols are used for calculations: + (plus), - (minus), * (multiply), /(divisor), %(mod), **(power of), etc.
Remember, Divisor and Mod are NOT the same.
Divisor in Python will output the quotient, while Mod in Python will output in the remainder
e.g. 67%3
print(67/3) ---> Output:22.3333333333333333 while
print(67%3) ---> Output:1 (Becuase 67 = 3(22) + 1)
Tips: In operations, you can write it without using "".
*Becuase print("67%3") ---> Output: 67%3
Not 1.
- The Variable
Variables are used to save the value of numbers or the string, etc.
e.g. Variable1 = "Hello", Variable2 = 12
You will see that Variable1 is a string, while Variable2 is an interger.
- Updates variable
When you start have given the value of the variable, whenever you given a new value, it will save that new value instead.
e.g. txt = "Star"
txt = "Hello" --> txt will save the string "Hello" instead of "Star"
- Inputting
When you want to input value, you must use the operations input() in Python.
e.g. Name = input("What is your name?")
print(Name)
Input: What is your name?
When I input the name Chicken to the input
Output(Chicken)
- The connection
You can also combine the string into one!
e.g. "Hello " + "World!" ---> "Hello World!"
"Hello" + "World!" ---> "HelloWorld!"
"Hello" + " World!" ---> "Hello World!"
- When you want to combine between the string and the numbers, you must use the operations str() to change the datatype of numbers into the string.
e.g. print("Hello " + 123) ---> Output: ERROR
print("Hello " + str(123)) ---> Output: Hello 123
print("Hello" + str(123)) ---> Output: Hello123
It's time to make a code!
name = input("Hello!, please enter your name: ")
print("Hello, " + name + " " + str(2026) + "!")
Input: Hello!, please enter your name:
(I input the text "Apingfuturepro" to the input)
Output: Hello, Apingfuturepro 2026!
The end of Python for Beginners (1)