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
Snake case to camel case conversion March 10, 2022Snake Case To Camel Case Converter string = input ( "Enter the string in snake case: " ) print ( string . replace ( "_"...Read More
Camel Case to Snake Case conversion March 10, 2022Convert Camel Case To Snake Case string = input ( "Enter the string in camel case: " ) string = string [ 0 ]. lower () + string ...Read More
Mathematical Operators in python March 08, 2022 # +, - , * , /, // , %, ** print ( 5 + 5 ) print ( 5 - 5 ) print ( 5 * 5 ) print ( 5 / 5 ) print ( 5 / 4 ) print ( 5 // 4 ) print ( 10 % 9...Read More
Variables in Python March 07, 2022 text = "This is Xtra Coding." num = 15 text_me = "hello" # cannot use special character (except _ ) print ( text...Read More
Data Types in Python March 06, 2022a = "hello" b = 12 c = 8.6 print ( type ( a )) print ( type ( b )) print ( b + c ) # print(a+b) #String str #Integer int #Floa...Read More
Print function & Comments March 06, 2022print ( "Hello 'world' World" ) # This code prints hello world print ( 'Hello "world" World' ) print ( 2...Read More