Python c1
Python c1
What is Programming
Welcome to my course on Python programming. If you know me, you
know that I always start a beginner Python class with a fundamental
question - "What is Programming".
Programming is a way for us to tell computers what to do. The computer
is a very dumb machine and it only does what we tell it to do. Hence we
learn to program and tell computers to do what we are very slow at -
computation. If I ask you to calculate 5+6, you will immediately say 11.
How about 23453453 X 56456?
You will start searching for a calculator or jump to a new tab to calculate
the same. This 100 days of code series will help you learn Python from
starting to the end. We will start from 0 and by the time we end this
course, I promise you will be a Job ready Python developer!
What is Python?
Copy
import pandas
Quick Quiz
Write a program to print a poem in Python. Choose the poem of your
choice and publish your repl
Please make sure you attempt this. Might be easy for some of you but
please finish each and every task
Day 5 - Comments, Escape sequence &
Print in Python
Welcome to Day 5 of 100DaysOfCode. Today we will talk about
Comments, Escape Sequences and little bit more about print
statement in Python. We will also throw some light on Escape
Sequences
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:
To write a comment just add a ‘#’ at the start of the line.
Example 1
Copy
Output:
Copy
Example 2
Output:
Copy
Example 3:
print("Python Program")
#print("Python Program")
Copy
Output:
Python Program
Copy
Multi-Line Comments:
To write multi-line comments you can use ‘#’ at each line or you
can use the multiline string.
Example 1: The use of ‘#’.
Copy
Output:
p is greater than 5.
Copy
Copy
Output
p is greater than 5.
Copy
Escape Sequence Characters
To insert characters that cannot be directly used in a string, we
use an escape sequence character.
An escape sequence character is a backslash \ followed by the
character you want to insert.
An example of a character that cannot be directly used in a
string is a double quote inside a string that is surrounded by
double quotes:
Copy
Copy