Posts

Showing posts from May, 2024

String editor and more information

what is  variable variable's example a = 'hello' String creat simple programe print  Print ('hello world') String example  a = 'fida' b = (a.upper ()) print (b) String editor name count editor using   Ans is (1) A = 'fida' print (A.count('fida')) endswith editor using a = 'fida///' b = (a.endswith('///')) Ans is (True) count len Upper lower split  rstrip  capitalize  replace  center  index isalnum isalpha isupper islower isprintable isspace istitle endswith startswith swapcase title while loop Simple programe A = 1 while A <= 11:                       print (A)                          A += 1                            if A == 6:                           ...

Calculator code

Calculator code  first = int(input('enter your first number :' )) operater = input('enter operater number [ +,-,*,/,% [ :' )         second = int(input('enter second number : ')) if operater =='+':         print (first+second) elif operater =='-':         print (first-second) elif operater =='*':         print (first*second) elif operater =='/':         print (first/second) elif operater =='%':         print (first%second) else :         print ('invaled operation') Upgrade Calculator code name = input('enter your name ')                                  first = int(input('inter first number ..... ')) op = input('inter operater +..-..*../..%..//..**.. ') second = int(input('inter second number ........... '))           if op == '+':...