lst = [31,4,5,6,61,31,4,5,6,61,31,4,5,6,61,31,4,5,6,61,31,4,5,6,61,3 1] var = len(lst) print(var)
Read moreAs Strings we can also slice lists: It's also start from 0 to unlimited myFruit = ["Apple", "Cherry", "Waterm...
Read morePython Collections: 1. Lists = [] 2. Tuple = () 3. Set = {} 4. Dictionary = {}
Read morest = "This is a string with double spaces" doubleSpaces = st.find( " " ) print (doubleSpaces) .find is an funct...
Read morefrom playsound import playsound #pip install playsound playsound( 'C: \\ Users \\ Admin \\ Downloads \\ Python Course with Notes \\...
Read morea = int ( input ( "Enter 1st Num: " )) b = int ( input ( "Enter 2nd Num: " )) div = a % b print (div)
Read moreName = input ( "Enter Your Name: " ) Age = int ( input ( "Enter Your Age: " )) letter = Name if (Age < 18 )...
Read moreprint ( 5 * 1 ) print ( 5 * 2 ) print ( 5 * 3 ) print ( 5 * 4 ) print ( 5 * 5 ) print ( 5 * 6 ) print ( 5 * 7 ) print ( 5 * 8 ) print ( 5 ...
Read morea = int ( input ()) b = input () c = float ( input ()) print ( type (a)) print ( type (b)) print ( type (c))
Read morea = int ( input ( "Enter 1st number: " )) b = int ( input ( "Enter 2nd number: " )) sum = a + b print ( sum...
Read morename1 = "Yash" name2 = "Reyansh" temp = "This is a {} and he is a good boy named {}".format(name1,name2) tem...
Read moreif u want to replace ur string character from s to t u can do this: name = "yash" var = name.replace("s","t"...
Read moreIf u want to convert ur string into upper case you can type: name = "yash" var = name.upper() print(var)
Read moreIf u want to convert ur string into lower case you can type: name = "YASH" var = name.lower() print(var)
Read moreIf u want to know your length of your string just type: name = "YASH" print(len(name))
Read moreIt will not print out the spaces like name = " yash " print(name .strip())
Read moreit is start from 0 to unlimited name = "yash" print(name[2:4]) name = "yash" print(name[3])
Read moreIf you want that you need to: e = "31" print(e+2) Now u cannot add strings But u trying again and again to add it So let me tell...
Read moreA = 42 See, If u will type a variable like: varA = type(A) print(varA)
Read more1. It should start from letter or underscore 2. It should not start from number 3. It is case sensitive like 'Yash' and 'yash...
Read moreImagine u have a icecream box (empty) Now u can store icecream Like above in python: U can create a variable which stores number,alphabet ...
Read moreIn modules it is something that is already Created To download: pip install module What is Pip: Pip is a name that let's you download ...
Read more'#' This is single line comment like if you press enter you will need to again do this ''' Multi line comments ...
Read moreThis is when you are inside if you will press enter without giving space if(age<18): def div def
Read more