Skip to content

Latest commit

 

History

History
156 lines (114 loc) · 2.65 KB

File metadata and controls

156 lines (114 loc) · 2.65 KB

backup Github Repo of 100 episodes

Go to your project folder using Finer -> Right Click -> New Terminal at folder
source venv/bin/activate
uvicorn main:app --reload
print("hello world")

Day2

print(value := 10) #walrus operator

Day3

# pep3 install pandas #pip3 for mac termincal```
# import pandas

Day4

println(17*13)

Day5

# This is a comment

# for multi line comment use triple ''' or """

# Alt + ↓ #to move line

# Escape Sequence Characters \n \"
print("I am a good \"boy\" and\nthis is new line")

print("Hey", 6, 7, sep="~", end="009\n")

Day6

a=1
b=True
c="Harry"
d=None
print("the type of a is:", type(a))
print("the type of a is:", type(b))


# Sequenced Data: list, tuple
list1 = [8, 2.3, [-4,5], ["apple","banana"]] #changeable
print(list1)
tuple1 = (("parrot","sparrow"), ("lion, tiger")) #unchangeable
print(tuple1)

# Mapped Data: dict
dict1 = {"name":"Shayan", "age":20, "is_engineer":True} #key-value pairs
print(dict1) 

# everything in python is object

Day7

print(5+2) #7
print(5-2) #3
print(5*3) #15
print(2**4) #2^4=16
print(5/2) #2.5
print(5//2) #2

Day8

# Alt + Shift + ↓ #copy line
# Alt + Click #multiple cursors

Day9 - type conversion

#explicit type conversion
a = "1"
b = "2"
print(int(a) + int(b)) 

#implicit type conversion
c = 1 # int will be converted into float 1.0
# python convert lower data type to higher data type to prevent data loss
d = 2.1
e = c + d
print(e) 
print(type(e)) #<class 'float'>

Day10 - input()

a = input("Enter first number:")
b = input("Enter second number:")
print("The sum of two numbers is:", int(a) + int(b))

Day11 - Strings

name = "Shan"
print(name[0] + "= index:" + str(name.index('S'))) #S at index: 0
items = "Mango"
for i in items:
    print(i)

Day12 - Strings Slicing

fruit = "Mango"
print(len(fruit)) #5
print(fruit[0:4]) #Mang
print(fruit[:4]) #Mang
print(fruit[1:]) #ango
print(fruit[:]) #Mango
print(fruit[-1]) #same as fruit[4] #o => len(fruit)-1: 5-1=4
print(fruit[-4:-2]) #fruit[1:3] #an

Day13 - Strings Method

a = '!Harrry!!!' #string are immutable
print(a.upper()) #HARRY!!!
print(a) #!Harrry!!!
print(a.rstrip('!')) #!Harrry
b = 'a b c'
print(b.split( )) #['a', 'b', 'c']

📷 19:58 record with OBS + continuity camera