Skip to content

Commit 2f36598

Browse files
author
Sahil
committed
Add lecture 2 outline
1 parent 8a738de commit 2f36598

File tree

3 files changed

+67
-1
lines changed

3 files changed

+67
-1
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ To discuss any doubts or questions after today's class with the community, join
1212

1313
# Lectures
1414
- Lecture 1: [[Notes]](/lecture1.md) [[Video]](https://www.youtube.com/watch?v=OrzXiZKtudA) - Installing Python, REPL, using Python as a calculator, basic data types, input and output
15-
- Lecture 2: coming tomorrow.
15+
- Lecture 2: [[Notes]](/lecture2.md)

day2/recap.py

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Quick Recap
2+
3+
# variables
4+
lecture_day = 2
5+
print(lecture_day)
6+
7+
# numbers can be int, float or complex
8+
square_area = 36
9+
circle_area = 6.28
10+
iota = (-1) ** (1/2)
11+
print(square_area, circle_area, iota)
12+
13+
# basic mathematical operators
14+
print(square_area + circle_area)
15+
print(4 * square_area)
16+
print(iota/square_area)
17+
18+
# type function
19+
print(type(iota))
20+
21+
# strings
22+
greeting = "Hello from Scaler!"
23+
print(greeting)
24+
25+
# f-strings
26+
msg = "Hello from"
27+
name = "Scaler"
28+
print(f"{msg} {name}!")
29+
30+
# input from user
31+
num1 = int(input())
32+
num2 = int(input())
33+
print(num1 + num2)
34+
35+
# none value
36+
x = None
37+
print(x)

lecture2.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Day 2: Flow Control
2+
3+
## Day 1 Recap
4+
[Basics of Python](day2/recap.py)
5+
6+
## Operators
7+
- and
8+
- or
9+
- not
10+
- comparisons (<, >, ==, !=)
11+
12+
## Conditionals
13+
- if
14+
- else
15+
- elif
16+
17+
## Loops
18+
- for
19+
- while
20+
21+
## Jump statements
22+
- break
23+
- continue
24+
25+
## Functions
26+
- Defining functions
27+
- Calling functions
28+
- Function scope
29+
- Recursive functions

0 commit comments

Comments
 (0)