*args October 10, 2022*args # def add(a,b): # return a+b # print(add(2,3,4,5)) def add (* args ): #----> Parametres # * makes a tuple of arguments x =...Read More
Set Comprehension October 09, 2022 Set Comprehension s = { i ** 3 for i in range ( 1 , 11 )} print ( s ) l = [[ 1 , 2 , 3 ],[ 4 , 5 , 6 ],[ 7 , 8 , 9 ]] s1 = { i for ...Read More
Dictionary Comprehension-2 October 08, 2022 Dictionary Comprehension d = {} for i in range ( 1 , 11 ): if i % 2 == 0 : d [ i ] = "Even" else : ...Read More
Dictionary Comprehension October 07, 2022 Dictionary Comprehension d = { 1 : 1 , 2 : 8 , 3 : 27 } d1 = {} for i in range ( 1 , 11 ): d1 [ i ] = i ** 3 print ( d1 ) d2 = {...Read More
List Comprehension October 06, 2022List Comprehension # l = [] # for i in range(1,11): # l.append(i**3) # print(l) # x = [i**3 for i in range(1,11)] # print(x) # n = [...Read More
Sets October 05, 2022Sets # set --> unordered collection of unique data s = { 1 , 2 , 3 , 4 , 5 , 1.1 , "1" } print ( s ) l = [ 2 , 1 , 3 , 4 , 5 ...Read More
Question/Solution - 8 October 04, 2022Question # {1:2,2:4,3:6,4:8,5:10,6:12,7:14,8:16,9:18,10:20} --- > 2 # input from user----> number # key ----> range(1,10) ...Read More
Dictionary methods October 02, 2022 Dictionary Methods d = { "name" : "Adrika" , "age" : 14 , "class" : 9 } # fromkeys my_dict = di...Read More
Adding and Deleting Data (Dictionaries) October 01, 2022 Adding and Deleting Data (Dictionaries) d = { "name" : "Adrika" , "age" : 14 , "class" : 9 } # a...Read More
in keyword and looping on dictionaries August 22, 2022 in Keyword and looping on Dictionaries d = { "name" : "Adrika" , "age" : 14 , "class"...Read More
Dictionaries in Python August 20, 2022 Dictionaries in Python d = { "name" : "Adrika" , "age" : 14 , "class" : 9 , ...Read More
Tuples July 18, 2022Tuples days = ( "monday" , "tuesday" , "wednesday" , "thursday" , "friday" , ...Read More
Question/Solution - 7 June 29, 2022 Question l = [ 34 , 0 , - 12 , - 78 , 43 , 0 , 6 , - 1 , 0 , 86 , - 100 , 56 ] # [56, 0, -12, -78, 43, 0, 6, -1, 0, 86, -100, 34] ...Read More
Question/Solution - 6 June 25, 2022 Question l = [ 34 , 0 , - 12 , - 78 , 43 , 0 , 6 , - 1 , 0 , 86 , - 100 , 56 ] # Negative => [-12, -78, -1, -100] # Positive => [34,...Read More
Nested List June 21, 2022 Nested List l = [[ 1 , 2 , 3 ], [ 4 , 5 , 6 ], [ 7 , 8 , 9 ]] print ( len ( l )) print ( l [ 1 ]) print ( l [ 2 ][ 0 ]) for sl in l : ...Read More
Looping on lists June 19, 2022 Looping on Lists lang = [ "Python" , "Java" , "Javascript" , "C++" , "C#" ] for i in ...Read More
Join & Split Function June 17, 2022 Join & Split Function #split function # str ---> list string = "Xtra Coding" print ( string . split ( " " )) # ...Read More
is keyword V/S == June 16, 2022 is keyword V/S == lang1 = [ "Python" , "Java" , "Javascript" ] lang2 = [ "C++" , "Java" ...Read More
List Methods June 14, 2022 List Methods lang = [ "Python" , "Java" , "Javascript" , "C++" , "Java" , "C#"...Read More
Methods to delete data from the lists June 06, 2022 Methods to Delete Data from the Lists string = [ "string1" , "string2" , "string3" , "string2" , ...Read More
Methods to add data to the lists June 05, 2022 Methods to Add Data to the Lists string = [ "string1" , "string2" ] #append string . append ( "string3" ) pr...Read More