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
Question/Solution - 2 April 02, 2022Question name = "Adrika" print ( name . count ( "a" )) # Note: count method should work as case insensitive Solution ...Read More
String Methods March 31, 2022 String Methods name = "Adrika bhadauria" print ( len ( name )) # Gives the length of string print ( name . lower ()) # Conve...Read More
Assignment Operators March 29, 2022 Assignment Operators name = "Adrika" age = 13 # name += " Bhadauria" # name = name + " Bhadauria" # prin...Read More
Strings are Immutable March 28, 2022 Strings are Immutable user_name = "Xtra" # user_name[2] = "R" - Error new_user_name = user_name . replace ( "...Read More
Center Method March 26, 2022 Center Method Note : Center method is generally used to center align the string using specified character. user_name = ...Read More
Find and Replace Methods March 24, 2022 Find and Replace Methods name = "Adrika Bhadauria" # print(name.find("ik")) print (name.replace( " " , "...Read More
Strip Methods March 23, 2022 Strip Methods name1 = " Xtra " name2 = "Coding" print ( name1 + name2 ) print ( name1 . lstrip () + ...Read More
Step Argument March 22, 2022 Step Argument machine = "Computer" print ( machine [::]) # variable[start argument: end argument + 1: step argument] # writing 1...Read More
String Slicing March 22, 2022 String Slicing machine = "Computer" # print(machine[8]) - Error print ( machine [ 3 : 6 ]) # prints put from Computer print ( ...Read More
String Indexing March 20, 2022 String Indexing machine = "Computer" # C - 0 -8 # o - 1 -7 # m - 2 -6 # p - 3 -5 # u - 4 -4 # t - 5 -3 # e - 6 -2 # r - 7 ...Read More
Question/Solution - 1 March 18, 2022Ouestion # user name - Adrika (Input) # user age - 13 (Input) # Adrika's age is 13 (Output) #User will be 14 next...Read More
String Formatting March 16, 2022 String Formatting user_name = "Adrika" age = 13 print ( "User's name is " + user_name + ". User's age ...Read More
Taking two or more inputs in one line in Python March 15, 2022Taking two or more inputs in one line in Python # first_name = input("Enter your first name: ") # second_name = input("Ente...Read More
Taking Input from User March 14, 2022 Taking Input from User user_name = input ( "Enter your name: " ) print ( "Your name is " + user_name ) age = input ...Read More
String Concatenation March 13, 2022 String Concatenation a = "Xtra" b = "Coding" print ( a + b ) print ( "Xtra " + "Coding" ) print...Read More
Escape Sequences in Python March 12, 2022 Escape Sequences in Python text = 'Hey, What \' s up?' print ( text ) # \' => ' # \" => " path = ...Read More