Assignment 3
Assignment 3
# x axis values
x = [1,2,3]
# corresponding y axis values
y = [2,4,1]
2. Write a program to use different type of markers and line styles on the plot.
marks = []
for i in range(0, len(students)):
marks.append(random.randint(0, 101))
plt.xlabel("Students")
plt.ylabel("Marks")
plt.title("CLASS RECORDS")
plt.plot(students, marks, 'm--')
plt.show()
3. Write a Python program to calculate the electricity bill. Accept the last meter reading
and current meter reading and the rate per unit from the user. Calculate the number of
units and total bill consumption for the user
# Input: last meter reading, current meter reading, and rate per unit
last_meter_reading = float(input("Enter the last meter reading: "))
current_meter_reading = float(input("Enter the current meter reading: "))
rate_per_unit = float(input("Enter the rate per unit: "))
4. Write a program to determine if two strings are anagrams (i.e., they have the same
characters in a different order).