Skip to main content

Posts

HOW TO MAKE MENUBAR

Recent posts

HOW TO COSTOMIZE THEMES

  DFJGHDFKJGHFKJGHDFJ

HOW TO MAKE BLOG WEBSITE

 HOW TO MAKE BLOG 👊👊 STEP 1 - OPEN GOOGLE CHROME  STEP 2 - TYPE  - BLOGGER -> CLICK  CREATE NEW BLOG STEP 3  - SELECT GMAIL ACCOUNT STEP 4 - NAME YOUR BLOG -> WEBSITE NAME 

Swap two variables in one line

  X = 77 Y = 708 X,Y =Y,X print("after swapping x value and y is- ",X,Y)

Python String Count(), len() , find() Built in Functions

  in python count() function is used to get total count of given element  in a string. the counting starts from string starts to till end. Ex. str1 = "Saransh" str_count = str1.count("a") print("the count of 'a'is",str_count) output String len() Ex. x = "Hello,Saransh" print(len(x)) output 13 String find() with len() // without space Ex. txt = "HelloMynameisSaransh" print(txt.find("e")) print(txt.find("Saransh")) print(txt.find("h")) print(len(txt)) output

Python Username and Password using if .. else

 Easy ways to check username and password by using simple if else statement. Ex. username = "saransh" password = "Saransh77" x = input("enter your username- ") y = input("enter your password- ") if x == username: if y == password: print("Okay Right..!") else: print("please enter correct username or password.") OUTPUT

Python If...else Statement

  Simple If  Statement x = 23 if x > 0: print("x is positive value") print("this is always printed") x = -1 if x > 0: print(x, "is positive number") print("this is also always printed") Output If...Else statement a = -7 if a > 0: print(a, " is positive") else: print(a," is Negative") output