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
Basics of Lists May 21, 2022 Basics of Lists mixed = [ "Xtra" , "Coding" , 14 , 1.6 , True , False ] print ( mixed ) print ( mixed [:: 2 ]) number...Read More
Scope of Variables May 18, 2022Scope of Variables num = 20 # Global variables def test1 (): global num num = 10 # Local variables return num # def ...Read More
Default Parameter May 17, 2022 Default Parameter def add_two ( a , b = 5 ): return ( a + b ) print ( add_two ( 5 ))Read More
Define Greatest May 16, 2022 Define Greatest def greatest ( a , b , c ): if a > b and a > c : print ( a ) else : if b > c : ...Read More
Print Vs Return May 15, 2022 Print Vs Return def add_three ( a , b , c ): print (a+b+c) sum_three = add_three( 2 , 3 , 5 ) print (sum_three) def add_three ( a...Read More
Functions in Python May 07, 2022 Functions in Python def add_two ( a , b ): #Parametre return ( a + b ) print ( add_two ( 2 , 3 )) #ArgumentsRead More
Break and Continue Keyword May 05, 2022 Break & Continue Keyword # Break for i in range ( 1 , 11 ): if i == 5 : break print ( i ) # Continue for ...Read More
Question/Answer - 5 May 03, 2022Question # start - 1 # end - 11 # 1 + 3 + 5 + 7 + 9 + 11 = 36 # Add odd number between the number entered by user(including those number...Read More
For Loop in Python April 28, 2022 For Loop in Python #Prints counting from 0 - 9 for i in range ( 10 ): print ( i ) #Will print odd numbers from 1 - 10 for i i...Read More
Question/Solution-4 April 26, 2022Question # 5 - 120 - example # 5 * 4 * 3 * 2 * 1 # user input - ?? output - factorial of user input ...Read More
While loop in Python April 13, 2022 While loop in Python # "Xtra Coding" - 10times i = 1 while i <= 100 : print ( i ) i += 1Read More
Check Empty or Not in Python April 13, 2022 Check Empty or Not in Python name = " " if name : # condition will be true if string will not be empty print ( "Stri...Read More
"in" keyword in Python April 13, 2022 "in" keyword in Python if "d" in "Adrika" : print ( "Present" ) else : print ( "Not...Read More
"and" and "or" Operator in Python April 12, 2022 "and" and "or" Operator in Python num1 = 10 num2 = 20 if num1 == 10 and num2 == 20 and num1 < num2 : p...Read More
Question/Solution - 3 April 10, 2022Question Make a Simple calculator which will calculate two numbers and ask the numbers and operator from the user. Answer num1 = int ( inpu...Read More
Nested if-else Statement April 10, 2022 Nested if-else Statement # Condition1 - if # Condition1 - if # Condition1 - if # Condition2 - else # Condition2...Read More
If-elif-else Statement in Python April 06, 2022 If-elif-else Statement in Python num = 15 if num == 5 : print ( "Number is 5." ) elif num == 10 : # Note: elif co...Read More
Pass Statement in Python April 05, 2022 Pass Statement age = 15 if age < 15 : pass # Pass statement is a type of placeholder for future codeRead More
If-else statement in Python April 04, 2022 If-else statement num = 5 if num == 5 : print ( "Number is 5." ) if num == 10 : print ( "Number is 10.&...Read More
If statement in Python April 03, 2022 If statement num = 10 if num == 10 : # Condition print ( "Number is 10." ) # Runs when condition is true print ...Read More