L O A D I N G ## January 2023 Evening

`#interpreter: Python Rprint("Hello")print(5+4)print('5+4=',5+4,'so what even 4+5=',4+5)a=5  # variableprint("type of a in line #5 is ",type(a))print("a = ",a)#type of data (datatype) is integer - numbers without decimal point -99999,999a = 5.0  #data type is float - numbers with decimal point, -999.5, 0.0, 99.9print("type of a in line #9 is ",type(a))a = 5j # i in Maths - square root of -1print("type of a in line #11 is ",type(a))#square root of -4 = 2iprint("a*a = ",a*a) #a=9print("a = ",a)#function - print(), type()# ,#variable - constant# is comment - Python these are not for you. these for usa="HELLO" #text - in python type - string  strprint("type of a in line #21 is ",type(a))`

a = True #boolean = True or False
#print(type(a))
print(“type of a in line #24 is “,type(a))
#compiler: C. C++ Java

#Android – STORY MANTRA – after you login
#Technical -> Python, R ,

`print("Hello")  #fist lineprint('irte834t8ejviodjgiodfg0e8ruq34tuidfjgiodafjgodafbj')`

print(5+3)
print(‘5+3’)
print(‘5+3=’,5+3,“and 6+4=”,6+4)
#whatever is given to print() shall be displayed on the screen
#syntax – rules (grammar)

## DAY 1 (Second batch) - Click to Access

`#print(), type()#comments#data types: int, float, str,bool, complex#variables - will accept alphabets, numbers and _price = int(51.9876);quantity = 23;total_cost = price * quantity;print(total_cost);print("Given price is",       price,"and quantity bought is",quantity,"so total cost will be",total_cost)# f stringprint(f"Given price is {price:.2f} and quantity bought is {quantity} so total cost will be {total_cost:.2f}")player = "Sachin"country = "India"position = "Opener"print(f"{player:<15} is a/an {position:>15} and plays for {country:^15} in international matches.")player = "Mbwangebwe"country = "Zimbabwe"position = "Wicket-keeper"print(f"{player:<15} is a/an {position:>15} and plays for {country:^15} in international matches.")#Sachin     is a/an Opener        and plays for India     in international matches.#Mbwangebwe is a/an Wicket-keeper and plays for Zimbabwe  in international matches.#escape sequence  \print("abcdefghijklm\nopqrs\tuv\wx\y\z")# \n - newline# \n is used for newline in Pythonprint("\\n is used for newline in Python")# \\n is actually give you \n in Pythonprint("\\\\n is actually give you \\n in Python")`

## DAY 2 Video - format String

`# Data types - 5 main typesvar1 = 5print(type(var1))  # int - integer  -9999  0  5var1 = 5.0print(type(var1))  #float - numbers with decimalvar1 = 5jprint(type(var1))   #complex - square root of minus 1var1 = True  #False  #boolprint(type(var1))var1 = "hello"  #str - stringprint(type(var1))#input()  - is used to read a value from the usernum1 = float(input("Enter a number: "))print(f"{num1} is the number")print("Datatype of num1 is ",type(num1))var2 = "50"#implicit and explicit conversion# arithmetic Operations that can be performed on# numeric (int, float, complex): i/p and o/p both are numbersnum1 = 23num2 = 32  #assign 32 to num2print(num1 + num2) #additionprint(num1 - num2) #print(num1 * num2) #print(num1 / num2) #print(num1 // num2) #integer division: it will give you only the integer partprint(num1 ** num2) # Powerprint(num1 % num2) # mod modulus - remainder## comparison operator : input as numbers and output will be bool##  >  < == (is it equal?)  != ,  >=   <=num1 = 23num2 = 32num3 = 23print(num2 > num3)  # Tprint(num3 > num1) # Fprint(num2 >= num3)  #T - is num2 greater than or equal to num3 ?print(num3 >= num1)  # Tprint(num2 < num3)  # Fprint(num3 < num1)  # Fprint(num2 <= num3) # Fprint(num3 <= num1) #  Tprint(num2 == num3)  # Fprint(num3 != num1)  # F# Logical operator:  and or not# prediction 1:  Sachin or Saurav will open the batting - T# prediction 2:  Sachin and Saurav will open the batting  - F# actual: Sachin and Sehwag opened the batting#Truth table - on boolean values# AND Truth Table:###  T and T =>  T###  T and F => F###  F and T => F###  F and F => F# OR Truth Table:###  T or T =>  T###  T or F => T###  F or T => T###  F or F => F# NOT## not True = False## not False = True## Assignment 1: Get lenght and breadth from the user and calculate## area (l*b) and perimeter (2(l+b))## Assignment 2: Get radius of a circle from the user and calculate## area (pi r square) and curcumference (2 pi radius)`

## DAY 3 video

`#Logical operator: works on bool and returns bool only# and: all values have to be True to get the final result as True# or: anyone value is True, you get the final result as True# 5 * 99 * 7 * 151 * 45 * 0 = 0# 0 + 0 + 0 + 0+1 = 1print(True and True and False or True or True and True or False or False and True and True or False)num1 = 5num2 = 8print(num1 !=num2 and num1>num2 or num1<=num2 and num2>=num1 or num1==num2 and num1<num2)num3 = bin(18)  #0b10010print(num3)print("hex(18) = ",hex(18))   #0x12print("oct(18): ", oct(18))   #0o22print("hex(0b1101111) = ",hex(0b1101111))print("int(0b1101111) = ",int(0b1101111))#BITWISE Operators# left shift  (<<) / right shift (>>) operators work on only binary numbersprint("56 << 3 = ",56 << 3) #output  #111000000print(bin(56))print(int(0b111000000)) #448print("56 >> 4 = ",56>>7)  ## & and in bitwiseprint("23 & 12 = ",23 & 12)  #4print("23 | 12 = ",23 | 12)  #31print(bin(23))   #10111print(bin(12))   #01100#& 00100print(int(0b100))#               | 11111print(int(0b11111))# |  or in bitwisenum1 = 10#positive#negative# area of a circle = pi * r**2  (3.14 = pi)# circunference = 2 * pi * r`

## DAY 4 Video

`# Conditionsavg = 30if avg >=40:    print("Pass")  #indentation    print("Congratulations!")else: #incase of IF getting False condition    print("You have failed")    print("try again")#avg > 90 - Grade A#avg 80 to 90 - Grade B# avg 70 to 80 - Grade C#avg 60 to 70 - Grade D#avg 50 to 60 - Grade E#avg 40 to 50 - Grade F#avg <40 - Grade Gavg=30if avg>=40:    print("Pass")  # indentation    print("Congratulations!")    if avg>=90:        print("Grade A")        if avg >=95:            print("You win President Medal")    elif avg>=80:        print("Grade B")    elif avg >=70:        print("Grade C")    elif avg >=60:        print("Grade D")    elif avg >=50:        print("Grade E")    else:        print("Grade F")else:    print("You have failed")    print("try again")    print("Grade G")avg = 90if avg <40:    print("Grade G")elif avg <50:    print("Grade F")elif avg <60:    print("Grade E")elif avg <70:    print("Grade D")elif avg <80:    print("Grade C")elif avg <90:    print("Grade B")else:    print("Grade A")print("Thank you so much")`

## DAY 5 VIDEO

`num = 5if num > 0:    print("Number is positive")    if num % 2 == 1:        print("Its Odd")    else:        print("Its even")        if num % 3 == 0:            print("It is divisible by both 2 and 3. It is also divisible by 6")        else:            print("Its divisible by 2 but not 3")elif num == 0:    print("Neither Positive not negative")else:    print("Its Negative")#loops - repeating multiple lines of code#Python - 2 types of loops- one when you know how many times to repeat - FOR#repeat until some condition true  WHILE# range(a,b,c) #generates range of values - start from a, go upto b(exlusive), c=increment#range(2,6,2) = 2,4#range(5,9) = (2 val indicate a&b - c is default 1) => 5,6,7,8#range(5) = (its b, a is deafult 0 and c is default 1) = ?for i in range(3,9,2):    print("HELLO",i)for i in range(10):    print(i*2+2,end=", ")print("\n")for i in range(5):    print("*",end=" ")print("\n=================")'''* * * * * * * * * * * * * * * * * * * * * * * * * '''for j in range(5):    for i in range(5):        print("*",end=" ")    print()`

## DAY 6 VIDEO

`#for loopfor i in range(5):    print(i)print()for j in range(5):    for i in range(5):        print("*",end=" ")    print()'''*  * *  * * *  * * * * * * * * * '''for j in range(5):    for i in range(j+1):        print("*", end=" ")    print()'''* * * * * * * * * * * * * * * '''for j in range(5):    for i in range(5-j):        print("*", end=" ")    print()num,sum = 5,0while num <103:    sum+=num    print(num)    num+=5print("Sum = ",sum)i=0while True:    i=i+1    print("Hello, i is ",i)    ch=input("Enter y to stop: ")    if ch=='y':        break    print("One more hello")    if i%5==0:        continue    print("Another hello but not to print when its multiple of five")`

## Video Day 7

`a,b,c = 10,12,8if a>=b:    #either a is greater or equal    if a>=c:        print(f"{a} is greatest value")    else:        print(f"{c} is greatest value")else:    #b is greater    if b>=c:        print(f"{b} is greatest value")    else:        print(f"{c} is greatest value")#Assignmnt : Modify the above program to display 3 number is descending order#loops - repeating#FOR - how many times#range(a,b,c) - generates value from a upto b and increasing by c#range(5,19,4) - 5, 9,13,17#range(4,19,5) - 6,11,17#WHILE - repeating based on condition#############################Stringsstr1 = 'Hello how are you'str2 = "Im fine"str3 = '''How are you todayare you fine hope you feel better'''str4 = """I am fine todayexpecting to do wellI am feeling better now"""print(str3)print(str1 + " "+str2)print(str2*10)print("Lo" in str1)#indexing: slicing dicingprint(str1)print(str1)print(str2[-1])print(str1[6:9])print("->",str1[-11:-8])print("First 3 values: ",str1[:3])print("last 3 values: ",str1[-3:])#print(str1.upper())#string immutable - you cant edit the string#str1="K"  TypeError: 'str' object does not support item assignmentstr1 = "K"+str1[1:]print(str1)`

## Video Day 8

`str1 = "hello how are you?"print("last 3 characters: ",str1[-3:])for i in str1:    print(i)print(str1.islower())print(str1.isupper())print(str1.isalpha()) #str1 = "509058585855"print(str1.isdigit())print(str1.isspace())str1 = "hello how are you?"print(str1.title())print(str1.lower())print(str1.upper())str2 = "I am fine how are you doing today"target = "aeiou"count=0for i in str2:    if i.lower() in target:        count+=1print("Total vowels: ",count)result = str1.split()print(result)result2 = str1.split('ow')print(result2)result3 = "OW".join(result2)print(result3)print(str1.find('o',0,5))print(str1.replace("hello","HELLO"))print(str1)#strings are immutable`