What is python?
Python is a high-level, object-oriented programming language. Most beginners in the development field prefer Python as one of the first languages to learn because of its simplicity and versatility.
Executing the Python program.
take for example we have created a file named main.py and we want to run it we will do the following
Python3 main.py
Creating Functions in Python
for example : if we want to create a function to add two variables
def add_10(x):
return (10+x)
Data Types
- numbers
- strings
- boolean
- tuples
- lists
- dictionaries
control statements
- for loop
A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).
eg.
Print each fruit in a fruit list:
fruits = ["apple", "banana", "cherry"]
for x in fruits:
print(x)
- if statement
If statement:
a = 33
b = 200
if b > a:
print("b is greater than a")
Applications of Python.
Artificial Intelligence
Desktop Application
Automation
Web Development
Data Wrangling, Exploration And Visualization.
Top comments (0)