Q-1.Write a python program that will check for the following conditions:
If the light is green – Car is allowed to go
If the light is yellow – Car has to wait
If the light is red – Car has to stop
Other signal – unrecognized signal. Example black, blue, etc…
If the light is green – Car is allowed to go
If the light is yellow – Car has to wait
If the light is red – Car has to stop
Other signal – unrecognized signal. Example black, blue, etc…
Q-2.Write a program to check students’ grades. Your program should fulfill the following conditions:
Grade A – Outstanding
Grade B – Excellent
Grade C – Very Good
Grade D – Good
Grade E – Satisfactory
others – Unrecognized
A program should also ask to enter the student’s name, class, and section.
Grade A – Outstanding
Grade B – Excellent
Grade C – Very Good
Grade D – Good
Grade E – Satisfactory
others – Unrecognized
A program should also ask to enter the student’s name, class, and section.
Q-3.Modify the earlier program students’ grades in such a way that they should take in five subject marks. Find the total mark and their percentage. Your program should check for the following conditions:
If the percentage falls below 45, they are considered fail.
If the percentage is between 45 and 60, grade them as pass.
If the percentage is between 60 and 75, grade them as good.
If the percentage is between 75 and 85, grade them as very good.
If the percentage is between 85 and 100, grade them excellent.
If the percentage is below zero or above 100, it’s an error.
If the percentage falls below 45, they are considered fail.
If the percentage is between 45 and 60, grade them as pass.
If the percentage is between 60 and 75, grade them as good.
If the percentage is between 75 and 85, grade them as very good.
If the percentage is between 85 and 100, grade them excellent.
If the percentage is below zero or above 100, it’s an error.
Q-4.Write a program to trace your subject mark. Your program should fulfill the following conditions:
If the subject mark is below 0 and above 100, print “error: mark should be between 0 and 100 only”
Students will fail in the subject if their mark is below 50.
Students will pass in the subject if they score 50 and above.
If subject mark is between 50 and 60, grade student as good.
If subject mark is between 60 and 80, grade student as very good.
If subject mark is between 80 and 100, grade student as outstanding.
Make sure to print their mark in every statement to prove that the condition is fulfilled. Moreover, name, class, and section should be also displayed along with the marks and their grade.
If the subject mark is below 0 and above 100, print “error: mark should be between 0 and 100 only”
Students will fail in the subject if their mark is below 50.
Students will pass in the subject if they score 50 and above.
If subject mark is between 50 and 60, grade student as good.
If subject mark is between 60 and 80, grade student as very good.
If subject mark is between 80 and 100, grade student as outstanding.
Make sure to print their mark in every statement to prove that the condition is fulfilled. Moreover, name, class, and section should be also displayed along with the marks and their grade.
Q-5.Write a Python program to check if the number is divisible by 5 or not.
Q-6.The Paschim Gujarat Vij Company Ltd. computes the electricity bill based on the following matrix:
Units Consumed Charges
0-100 0.50 per unit
101-200 Rs. 50 plus Rs. 1 per unit over 100 units
201-300 Rs. 150 plus 1.50 per unit over 200 units
> 300 Rs. 300 plus Rs.2 per unit over 300 units
Ask user to enter the Past meter reading and current meter reading.
Find the units consumed.
Compute the bill according to given matrix.
Units Consumed Charges
0-100 0.50 per unit
101-200 Rs. 50 plus Rs. 1 per unit over 100 units
201-300 Rs. 150 plus 1.50 per unit over 200 units
> 300 Rs. 300 plus Rs.2 per unit over 300 units
Ask user to enter the Past meter reading and current meter reading.
Find the units consumed.
Compute the bill according to given matrix.
Q-7.The Sardar Patel Cricket Stadium, Motera has the following rates for different types of seats:
Ordinary – 2500
Pavillion – 3500
Upper Pavillion – 4500
Commentary Box – 6000
VIP – 8000
They are giving 10% discount for online booking and 8% discount for advance booking and no discount is given for booking on match day from ticket window.
Ask user to enter the booking type like online, advance or window booking.
Ask user to select the types of seats.
Compute the amount and print the ticket with proper format.
Ordinary – 2500
Pavillion – 3500
Upper Pavillion – 4500
Commentary Box – 6000
VIP – 8000
They are giving 10% discount for online booking and 8% discount for advance booking and no discount is given for booking on match day from ticket window.
Ask user to enter the booking type like online, advance or window booking.
Ask user to select the types of seats.
Compute the amount and print the ticket with proper format.
Q-8.Write a Python program which accept n numbers in a list and display even sum,odd sum and total sum.
Q-9.Write a Python program which accept a number from the user and display square if number is less then 5 display cube if number is less than 10 otherwise table of that number.
Q-10.Write a Python program which acept a string from the user and count vowels.