Professional Documents
Culture Documents
def add(x, y)
return x + y
return x - y
return x * y
return x / y
print("Select operation.")
print("1.Add")
print("2.Subtract")
print("3.Multiply")
print("4.Divide")
while True:
if choice == '1':
if next_calculation == "no":
break
else:
print("Invalid Input")
Ques2 PROGRAM TO FIND PASS OR FAIL
b=int(input("Marks In Mathematics:"))
c=int(input("Marks In Accounts:"))
d=int(input("Marks In Economics:"))
f=(a+b+c+d+e)*100/500
if f>=33:
else:
import numpy as np
import matplotlib.pyplot as plt
X = ['HYDERABAD','BANGALORE','MUMBAI','DELHI']
Y = [6809970,8425970,12442373,11007835]
X_axis = np.arange(len(X))
plt.xticks(X_axis, X)
plt.xlabel("CITIES")
plt.ylabel("Number of POPULATION")
plt.title("POPULATION IN CITITES ")
plt.legend()
plt.show()
ques4 PROGRAM TO PLOT CHART OF SIN AND COS
import matplotlib.pyplot as pl
import numpy as np
y = np.cos(x)
y1 = np.sin(x)
pl.plot(x,y)
pl.plot(x, y1)
pl.show()
ques5 WRITE A PROGRAM TO PLOT BAR CHART IN PYTHON TO
DISPLAY THE RESULT OF A SCHOOL FOR FIVE CONSECUTIVE
YEARS.
j=["b","g","r","m","c"]
plt.xlabel("years")
plt.ylabel('"pass%"')
plt.show()
ques6 PROGRAM TO PLOT MULTIRANGE LINE CHART
import numpy as np
x = [1,2,3,4,5]
y = [3,3,3,3,3]
plt.legend()
plt.show()
ques7 PROGRAM TO PLOT SCATTER CHART
import numpy
plt.scatter(x, y)
plt.show()
ques8 PROGRAM TO CREATE DATAFRAME DISPLAY DETAILS OF
TEACHER
import pandas as pd
df = pd.DataFrame(dict)
print(df)
ques9 PROGRAM TO PLOT BAR CHART WITH GRID
plt.rcParams["figure.autolayout"] = True
plt.show()