Basic Fundamentals
Basic Fundamentals
What is Python?
▪ Python is an interpreted, object-oriented, high-level programming language.
▪ It was created by Guido van Rossum, released in 1991.
It is used for:
▪ Web Development (server-side),
▪ Software Development
▪ Data Science and Data Visualization
▪ Machine Learning
▪ Script for Vulnerability Testing
Printing
Python uses print() function to display text or value.
Examples:
▪ print(“Hello world”)
▪ print(‘Hello world’)
▪ print(30)
▪ print(1.5)
Escape Character
▪ To insert characters that are illegal in a string
▪ An escape character is a backslash \ followed by
the character you want to insert.
Examples:
▪ \’ - Single Quote
▪ \” - Double Quote
▪ \\ - Backslash
▪ \n - New Line
▪ \t - Tab
Indentation
Python uses indentation to indicate code block.
x = str(3)
y = int(3)
z = float(3)
Basic types of placeholders
name = “John”
age = 30
print(“My name is %s, I am %d years old.” %(name, age) )
item = "milk"
price = 35.526
item = "milk"
price = 35.50