Python Coding 101 Installing, Running, Writing, Data Types & Control
Join Our Telegram Group For Govt Jobs, Private Jobs, Company Jobs, Syllabus & Much More

Python Coding 101 Installing, Running, Writing, Data Types & Control
Python is a versatile and popular programming language used by developers for a wide range of applications, including web development, data science, machine learning, and automation. If you’re interested in learning Python, then you’re in luck! In this article, we’ll cover the basics of Python coding 101, from installing Python to writing your first Python program.
Installing Python Coding 101
Before you can start coding in Python, you’ll need to install it on your computer. Python can be downloaded and installed from the official Python website, www.python.org. Choose the appropriate version for your operating system (Windows, macOS, or Linux), and follow the installation instructions.
Running Python Coding 101
Once you’ve installed Python, you can open a Python shell by typing “python” in your terminal or command prompt. This will open the Python interpreter, where you can write and run Python code line-by-line.
Alternatively, you can use an Integrated Development Environment (IDE) like PyCharm or Visual Studio Code to write and run your Python code. These tools offer features like code highlighting, autocomplete, and debugging, which can make the coding process faster and more efficient.
Writing Your First Python Coding 101 Program
Let’s start by writing a simple “Hello, World!” program in Python. Open a new file in your text editor or IDE and enter the following code:
pythonCopy codeprint("Hello, World!")
Save the file with a “.py” extension (e.g. “hello.py”), and then run it by typing “python hello.py” in your terminal. You should see the message “Hello, World!” printed to the console.
This simple program demonstrates the basics of Python syntax. The “print” function is a built-in function that displays text on the screen. In this case, we’re passing the string “Hello, World!” as an argument to the print function.
Variables and Data Types of Python Coding 101
In Python, variables are used to store data that can be referenced later in the program. To create a variable, simply assign a value to it using the “=” operator. For example:
makefileCopy codex = 5
y = "hello"
In this example, we’ve created two variables, “x” and “y”. “x” is assigned the value 5, which is an integer data type. “y” is assigned the value “hello”, which is a string data type.
Python supports several built-in data types, including integers, floats, strings, booleans, and lists. You can use the “type” function to determine the data type of a variable:
luaCopy codeprint(type(x)) # output: <class 'int'>
print(type(y)) # output: <class 'str'>
Operators and Expressions
Python supports a wide range of operators, including arithmetic operators (+, -, *, /), comparison operators (==, !=, <, >), and logical operators (and, or, not). These operators can be used to perform calculations and make decisions in your code.
For example, you can use arithmetic operators to perform calculations:
pythonCopy codex = 5
y = 2
print(x + y) # output: 7
print(x * y) # output: 10
You can use comparison operators to compare values:
pythonCopy codex = 5
y = 2
print(x == y) # output: False
print(x > y) # output: True
You can use logical operators to combine conditions:
makefileCopy codex = 5
y = 2
z = 7
print(x > y and x < z) # output: True
Control Flow
Control flow statements are used to control the order in which statements are executed in a program.