Professional Documents
Culture Documents
CODE:
# NAME: CHARAN SRIDHAR BHOGARAJU
# REGNO: 19BBS0094
a=float(input('Enter the side 1 of the Triangle: '))
b=float(input('Enter the side 2 of the Triangle: '))
c=float(input('Enter the side 3 of the Triangle: '))
ans ={a,b,c}
if a+b>c and b+c>a and c+a>b:
if len(ans)==1:
print("TRIANGLE IS EQUILATERAL")
elif len(ans)==2:
print("TRIANGLE IS ISOCELESS")
else:
print('TRIANGLE IS SCALENE')
else:
print("INVALID VALUES FOR TRIANGLE")
OUTPUT:
2. GRADING SYSTEM PYTHON CODE:
CODE:
# NAME: CHARAN SRIDHAR BHOGARAJU
# REGNO: 19BBS0094
grades={
"A+":4.0,
"A":4.0,
"A-":3.7,
"B+":3.3,
"B":3.0,
"B-":2.7,
"C+":2.3,
"C":2.0,
"C-":1.7,
"D+":1.3,
"D":1.0,
"F":0
}
gradeGOT=input("Enter Your grade: ").upper()
if gradeGOT in grades.keys():
print("YOUR GRADE POINT IS {}".format(grades[gradeGOT]))
else:
print("INVALID GRADE ENTERED")
OUTPUT:
CODE:
# NAME: CHARAN SRIDHAR BHOGARAJU
# REGNO: 19BBS0094
rating=float(input('Enter the Rating: '))
if rating==0.0:
print("UNACCEPTABLE PERFORMANCE")
print("EMPLOYEE SALARY RAISE is {}$".format(rating*2400.00))
elif rating==0.4:
print("ACCEPTABLE PERFORMANCE")
print("EMPLOYEE SALARY RAISE is {}$".format(rating*2400.00))
elif rating>=0.6:
print("MERITORIOUS PERFORMANCE")
print("EMPLOYEE SALARY RAISE is {}$".format(rating*2400.00))
else:
print("INVALID RATING GIVEN")
OUTPUT
4. WAVELENGTH OF LIGHT PYTHON CODE
CODE
# NAME: CHARAN SRIDHAR BHOGARAJU
# REGNO: 19BBS0094
wavelength=float(input('Enter the wavelength of light(nm): '))
if wavelength>=380 and wavelength<450:
print("Color of light is Violet")
elif wavelength>=450 and wavelength<495:
print("Color of light is Blue")
elif wavelength>=495 and wavelength<570:
print("Color of light is Green")
elif wavelength>=570 and wavelength<590:
print("Color of light is Yellow")
elif wavelength>=590 and wavelength<620:
print("Color of light is Orange")
elif wavelength>=620 and wavelength<=750:
print("Color of light is Red")
else:
print("INVALID WAVELENGTH PROVIDED")
OUTPUT