Posts

Showing posts from February, 2022

More Learnings

 Learnings # list1 = [["Harry",1],["Larry", 2],["Carry",6],["Marie",250]] # dict1 = dict(list1) # for item in dict1: # print(item) # print(dict1) # for item, lollypop in dict1.items(): # print(item, "and lolly is",lollypop)

My Learnings

 My Learnings # var1 = 6 # var2 = 56 # var3 = int(input()) # # if var3>var2: # print("Greater") # elif var3==var2: # print("Equal") # else: # print("Lesser") # print(15 not in list1) # if 15 not in list1: # print("no its not in list1")list1 = [1,2,3,5,6]

Some Dictionary Functions in Python

 Dictionary Functions d1 = {} # print(type(d1)) d2 = { "Akhand" : "paneer" , "Vaishnavi" : "egg" , "Rajesh Mama" : "chicken" , "Mummy" : "Roti" } # d2["Atharva"] = "Chai & Biscuit" # print(d2) # del d2["Atharva"] # d3 = d2.copy() # del d3["Rajesh Mama"] # print(d2.update({"Priya":"Toffee"})) # print(d2.keys()) print (d2.items())

Learnings

 My Learning grocery = [ "harpic" , "vim bar" , "deodrant" , "Bhindi" , 56 ] # print(grocery[4]) # numbers = [ 2 , 3 , 5 , 6 , 22 ] # print(numbers.sort()) # print(numbers.reverse()) # print(numbers) # numbers.append(71) # numbers.append(56) # numbers.append(54) # numbers.append(23 # numbers.insert(1,2) # numbers.remove(22) # numbers.pop() # print(numbers) # numbers[3] = 43 # print(numbers) #Mutable - can change #immutable - can't change # tp = (1,) # print(tp) a = 3 b = 4 a,b = b,a # temp = a # a = b # b = temp print (a,b)

String Fuctions

 Some String Fnctions mystr = "Akhand is a good boy" print(mystr.endswith("bdoy")) print(mystr.count("o")) print(mystr.capitalize()) print(mystr.find("is")) print(mystr.upper()) print(mystr.replace("is","are"))

My Learnings

 Rough '''var1 = int("54") var4 = int("32") var2 = 4 var3 = 36.7 print(var1+var4) #print(type(var1)) ''' ''' str() int() float() ''' ''' print(10*" hello \n ") ''' ''' inpnum = input("enter number") print("you entered",int(inpnum)) '''

Sets in Python

 My Learning s = set () # print(type(s)) # l = [1,2,3,4,6] # s_from_list = set(l) # print(s_from_list) # print(type(s_from_list)) s.add( 1 ) s.add( 2 ) s1 = s.intersection({ 1 , 2 , 3 }) print (s,s1)

My Learning 2

 My Learning while ( True ): inp = int ( input ( "enter number \n " )) if inp> 100 : print ( "thanks \n " ) break else : print ( "try again \n " ) continue

My Learning

My Learning list1 = [ "bruh" , "hello" , int , "=" , 3 , 84 , 4 , 4 , 34332 , 2 , 33 , 3 ] for item in list1: if type (item)== int and item> 6 : print (item)  

Just a programme in Python(PyCharm)

 A programme in Python print ( "Enter Your age" ) age = int ( input ()) if age< 18 : print ( "You can't drive" ) elif age== 18 : print ( "we will check your physical fitness first \n Then we will think about it" ) else : print ( "You can drive" )

My Sum Calculator in Python(PyCharm)

 Sum Calculator In Python print ( "enter 1st number" ) a = input () print ( "enter 2nd number" ) b = input () print ( "the sum is" , int (a)+ int (b))

My short dictionary in python(pycharm)

My Dictionary print ( "Welcome to Akhand's Dictionary" ) d1 = { "Abandoned" : "having been deserted or left" , "upset" : "Sad" , "Dictionary" : "a book or electronic resource that lists the words of a language (typically in alphabetical order) and gives their meaning, or gives the equivalent words in a different language, often also providing information about pronunciation, origin, and usage." , "Poop" : "Solid Waste" } print ( "Enter word" ) a = input () print (a, "Means" , end = " " ) print (d1[a])