Python
Python
and the modules which need to be installed are known as external modules
like pip install pandas which can be written in prompt command also known as
terminal
here I had installed replit to perform python operations the main code can be
written in main.py and output can be seen through console
the motive to instal replit is cauzz here it is easy to access as well as incase
if we have to import pandas replit directly installs it
for instance import hashlib is builtin module so their is no need to install that
modulde
but import tensorflow is external module so replit directly installs that module
print function is used to write something and the main information is filled in
brackets if it is in the string form or in the form of words then double inverted
commas are used
and if it is in numerical form then brackets are not used
# Python Comments
A comment is a part of the coding file that the programmer does not want to execute,
rather the programmer uses it to either explain a block of code or to avoid the
execution of a specific part of code while testing.
## Single-Line Comments:
### Example 1
```python
#This is a 'Single-Line Comment'
print("This is a print statement.")
```
Output:
```markup
This is a print statement.
```
### Example 2
```python
print("Hello World !!!") #Printing Hello World
```
Output:
```markup
Hello World !!!
```
### Example 3:
```python
print("Python Program")
#print("Python Program")
```
### Output:
```markup
Python Program
```
## Multi-Line Comments:
To write multi-line comments you can use ‘#’ at each line or you can use the
multiline string.
```python
#It will execute a block of code if a specified condition is true.
#If the condition is false then it will execute another block of code.
p = 7
if (p > 5):
print("p is greater than 5.")
else:
print("p is not greater than 5.")
```
Output:
```markup
p is greater than 5.
```
```python
"""This is an if-else statement.
It will execute a block of code if a specified condition is true.
If the condition is false then it will execute another block of code."""
p = 7
if (p > 5):
print("p is greater than 5.")
else:
print("p is not greater than 5.")
```
### Output
```markup
p is greater than 5.
```
An escape sequence character is a backslash `\` followed by the character you want
to insert.
```python
print("This doesnt "execute")
print("This will \" execute")
```
```python
print(object(s), sep=separator, end=end, file=file, flush=flush)
```
## Other Parameters of Print Statement
1. object(s): Any object, and as many as you like. Will be converted to string
before printed
2. sep='separator': Specify how to separate the objects, if there is more than one.
Default is ' '
3. end='end': Specify what to print at the end. Default is '\n' (line feed)
4. file: An object with a write method. Default is sys.stdout
## [Next
Lesson>>](https://replit.com/@codewithharry/06-Day6-Variables-and-Data-Types)