a = input ("Enter any single character :" )
print (ord (a))
b = int (input ("Enter any number between 0-255" ))
if 0 <= b <= 255:
print (chr (b))
else :
print ("Invalid input" )
a = "Hello World"
b = 20
c = 20.623
d = 1j
e = ["apple" , "banana" , "cherry" ]
f = ("apple" , "banana" , "cherry" )
g = range (6)
h = {"name" : "John" , "age" : 36}
i = {"apple" , "banana" , "cherry" }
j = frozenset({"apple" , "banana" , "cherry" })
k = True
l = b"Hello"
m = bytearray (5)
n = memoryview (bytes (5))
o = None
print (type (a),type (b),type (c),type (d),type (e),type (f),type (g),type (h),type (i),type (l),type (k),type (l),type (m),type (n),type (o))
a = int (input ("Enter a value for a :" ))
b = int (input ("Enter a value for b :" ))
print (a,b)
a = a + b
b = a - b
a = a - b
print ("This is the value of a after swaping " ,a,"This is the value of b after swaping " ,b)
a = float (input ("Enter the coefficient of x2 :" ))
b = float (input ("Enter the coefficient of x :" ))
c = float (input ("Enter the constant value :" ))
d = ((-b)-((b*2)-4*a*c)(1/2))/2*a
e = ((-b)+((b2)-4*a*c)*(1/2))/2*a
print ("the value of x1" ,d,"The value of x2 :" ,e)
a = float (input ("Enter marks in external exam (out of 75) :" ))
b = float (input ("Enter marks in internal exam (out of 100) :" ))
if 0 <= a <= 75 and 0 <= b <= 100:
c = a/75*100
d = b/100*100
e = c/100*60
f = d/100*40
if e+f >= 75:
print ("Pass with " +str(e+f)+"%" )
else :
print ("Fail with " +str(e+f)+"%" )
else :
print ("Invalid input" )
print ("Enter item (idly,dosa,poori,chapati):" )
a = int (input ("How many idly's do you want to buy ? :" ))
b = int (input ("How many dosa's do you want to buy ? :" ))
c = int (input ("How many poori's do you want to buy ? :" ))
d = int (input ("How many chapati's do you want to buy ? :" ))
print ('\t\t' ," Total" )
print ('\t\t' ,'-' *10)
print ('Item\t\tQuantity\t\tAmount' )
print ('-' *50)
if a > 0:
print ('Idly\t\t' ,a,'\t\t\t' ,a*5)
if b > 0:
print ('dosa\t\t' ,b,'\t\t\t' ,b*20)
if c > 0:
print ('poori\t\t' ,c,'\t\t\t' ,c*10)
if d > 0:
print ('chapati\t\t' ,d,'\t\t\t' ,d*20)
print ('-' *50)
print ('Total\t\t' ,a+b+c+d,'\t\t\t' ,(a*5)+(b*20)+(c*10)+(d*20))
Mentor in IT,Dept of IT,RGUKT-SRIKAKULAM
duppada8@rguktsklm.ac.in
Projects
Minutes Of Support
Hard Worker