<jupyter_start><jupyter_text>JUMANJI GAME<jupyter_code>a = input("Left or right : ").lower()
if(a == 'right'):
    b = input("Will you go with the bus or car : ").lower()
    if(b=='car'):
        print("Game over !! Accident")
    elif(b=='bus'):
        print("Game won !! Reached the destination")
    else:
        print("Invalid command !! restart again")
elif(a == 'left'):
    b = input("Wil you go by walking or running : ").lower()
    if(b=='walking'):
        print("Reached destination !! Game Won")
    elif(b=='running'):
        print("Game over !! Fall from the vally")
else:
    print("Invalid command restart with the valid commands !")<jupyter_output>Reached destination !! Game Won<jupyter_text>Loops in python while loop<jupyter_code>a = 0
while(a<10):
    print("harsh",end=" ")
    a=a+1
    # a+=a  -> a=a+a<jupyter_output>harsh harsh harsh harsh harsh harsh harsh harsh harsh harsh<jupyter_text>for loop<jupyter_code>list = ['joshi' , 'vyas' , 'butani' , 'baniwal' ,'purohit']
for i in list:
    print("harsh" +" "+ i)
for i in range(0,10):
    print(i)<jupyter_output>0
1
2
3
4
5
6
7
8
9<jupyter_text>tuples<jupyter_code>tu = ('harsh' , 12 , 12.5 , True , 3+1j)
for i in tu:
    print(type(i))
list = ['harsh',123,12,True]
for i in list:
    print(type(i))
list[2] = 'Harsh'
list
tu[1] = 12
tu
tu2 = ([1,2,4],(1,2,34),True,12)
print(tu2)
tu2[0][2] = 5
print(tu2)<jupyter_output>([1, 2, 4], (1, 2, 34), True, 12)
([1, 2, 5], (1, 2, 34), True, 12)<jupyter_text>tuple unpacking<jupyter_code>tu2
a , b , c ,d  = tu2
print(a)
print(b)
print(c)
print(d)
tu[1]
tu
tu[1:3]
tu[:]
tu[:2]
tu[2:]<jupyter_output><empty_output><jupyter_text>Function<jupyter_code># def function_name :
#     function working
#         return 
def greet(n):
    a = 'radhe radhe !! ' + " " + n
    return a

greet('harsh')<jupyter_output><empty_output><jupyter_text>Recursive ness  factorial<jupyter_code>def fact(n):
    if(n==1 or n==0):
        return 1
    else:
        return n*fact(n-1)
fact(5)<jupyter_output><empty_output><jupyter_text>PROject 1 : calculate sum of n numbers by using recursion 🤘🤘<jupyter_code>def su(n):
    if(n==1):
        return 1
    else:
        return n+su(n-1)
su(6)<jupyter_output><empty_output><jupyter_text>Matrix multiplication and addition<jupyter_code>R = int(input("Please enter the rows of 1st matrix : "))
C = int(input("Please enter the columns of 1st matrix : "))
matrix1 = []
for i in range(0,R):
    a= []
    for j in range(0,C):
        b = int(input(""))
        a.append(b)
    matrix1.append(a)


for i in range(0,R):
    for J in range(0,C):
        print(matrix1[i][j],end="")
    print(" ")
M = int(input("Please enter the rows of 2nd matrix : "))
N = int(input("Please enter the columns of 2nd matrix : "))
matrix2 = []
for i in range(0,M):
    a= []
    for j in range(0,N):
        b = int(input(""))
        a.append(b)
    matrix2.append(a)
for i in range(0,R):
    for J in range(0,C):
        print(matrix2[i][j],end="")
    print(" ")
result = []
for i in range(0,R):
    a= []
    for j in range(0,N):
        a.append(0)
    result.append(a)
for i in range(0,R):
    for j in range(0,N):
        result[i][j] = matrix1[i][j] + matrix2[i][j]
for i in range(0,R):
    for j in range(0,N):
       print(result[i][j] , end=" ")
    print(" ")
for i in range(0,R):
    for j in range(0,N):
        for k in range(0,N):
            result[i][j] += matrix1[i][j]*matrix2[i][j]
for i in range(0,R):
    for j in range(0,N):
       print(result[i][j] , end=" ")
    print(" ")<jupyter_output>8 8  
8 8<jupyter_text>Liner and Binary Search<jupyter_code>def linear_search(list1, length_n, searching_element):
    for i in range(0,length_n):
        if(list1[i] == searching_element):
            return 1
    return -1
list1 = [1,2,3,2,4]
key = 2
list_length = len(list1)
a = linear_search(list1,list_length-1,key)
if(a==1):
    print("Element found ")
else:
    print("Element not found")<jupyter_output>Element found<jupyter_text>Binary Searching<jupyter_code>def Binary_Search(list100, value):
    low = 0
    high = len(list100)-1
    mid = 0
    while(low<=high):
        mid = (low+high)//2
        if(list1[mid]>value):
            high = mid-1
        elif(list1[mid]<value):
            low = mid+1
        else:
            return mid
    return  -1


list2 = [1,2,3,4,5]
a = Binary_Search(list2,2)
if(a!=-1):
    print("Element  found ")
else:
    print("Element not found")<jupyter_output>Element  found
{'fraction_non_alphanumeric': 0.17043673012318028, 'fraction_numerical': 0.03628219484882419, 'mean_word_length': 3.3191489361702127, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 40, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '11', 'dir': 'jupyter-structured-clean-dedup', 'id': '115484', 'license': 'MIT', 'n_tokens_mistral': 1855, 'n_tokens_neox': 1782, 'n_words': 429, 'path': 'pt2.ipynb', 'repo_name': 'Harshvardhan1609/Python_Tutorials_By_Harsh', 'size': '4465'}