Basic Python Words & Symbols Explained
import
Used to bring in Python modules (extra tools). Example: import time allows you to use time-related functions.
time
A module in Python used to work with time. Example: [Link](1) pauses the program for 1 second.
input()
Used to get input from the user. Example: name = input('Enter your name: ')
int()
Converts a string (text) into an integer (number). Example: int('5') becomes 5.
print()
Displays output on the screen. Example: print('Hello') shows Hello.
while
Starts a loop that repeats as long as the condition is true. Example: while x > 0 keeps going until x is 0.
[Link]()
Pauses the program for a number of seconds. Example: [Link](2) waits for 2 seconds.
seconds -= 1
Means subtract 1 from the current value of seconds. It's short for: seconds = seconds - 1
This is a comment. Python ignores anything after #. It's for humans to read.
=
Basic Python Words & Symbols Explained
Assignment operator. It stores a value in a variable. Example: age = 18
>
Comparison operator. Checks if something is greater. Example: if age > 17
==
Checks if two values are equal. Example: if x == 5
<
Checks if a value is less than another. Example: if x < 10
str
Data type for text. Example: 'hello' is a string.
int
Data type for whole numbers. Example: 5, 10, 999 are all integers.