Mod 2 Pi
Mod 2 Pi
Output
Hello, World!
How does this work:
● print() is a built-in function in Python that tells the program to display
something on the screen. We need to add the string in parenthesis of print()
function that we are displaying on the screen.
● “Hello, World!” is a string text that we want to display. Strings are always
enclosed in quotation marks.
Python Comments
Comments in Python are the lines in the code that are ignored by the interpreter
during the execution of the program.
● Comments enhance the readability of the code.
● Comment can be used to identify functionality or structure the code-base.
● Comment can help understanding unusual or tricky scenarios handled by the
code to prevent accidental removal or changes.
● Comments can be used to prevent executing any specific part of your code,
while making changes or testing.
Example:
# I am single line comment
""" Multi-line comment used
print("Python Comments") """
Explanation:
● In Python, single line comments starts with hashtag symbol #.
● Python ignores the string literals that are not assigned to a variable. So, we can
use these string literals as Python Comments.
Indentation in Python
In Python, indentation is used to define blocks of code. It tells the Python
interpreter that a group of statements belongs to a specific block. All statements
with the same level of indentation are considered part of the same block.
Indentation is achieved using whitespace (spaces or tabs) at the beginning of each
line.
Example:
if 10 > 5:
print("This is true!")
print("I am tab indentation")
print("I have no indentation")
Explanation:
● The first two print statements are indented by 4 spaces, so they belong to the if
block.
● The third print statement is not indented, so it is outside the if block.
Famous Application Built using Python
● YouTube: World’s largest video-sharing platform uses Python for features like
video streaming and backend services.
● Instagram: This popular social media app relies on Python’s simplicity for
scaling and handling millions of users.
● Spotify: Python is used for backend services and machine learning to
personalize music recommendations.
● Dropbox: The file hosting service uses Python for both its desktop client and
server-side operations.
● Netflix: Python powers key components of Netflix’s recommendation engine
and content delivery systems (CDN).
● Google: Python is one of the key languages used in Google for web crawling,
testing, and data analysis.
● Uber: Python helps Uber handle dynamic pricing and route optimization using
machine learning.
● Pinterest: Python is used to process and store huge amounts of image data
efficiently.