Python : Conditional Statement Test 6

  

Python : Conditional Statement Test 6

Q1. Accept three numbers from the user and display the second largest number.

Q2. Accept three sides of triangle and check whether the triangle is possible or not.

(triangle is possible only when sum of any two sides is greater than 3rd side)

Q3. Consider the following code

                                  

What will the above code print if the variables i, j, and k have the following values?

(a)    i = 3, j = 5, k = 7

(b)    i = -2, j = -5, k = 9

(c)    i = 8, j = 15, k = 12

(d)    i = 13, j = 15, k = 13

(e)    i = 3, j = 5, k = 7

(f)    i = 3, j = 5, k = 7

Q4. Accept the electric units from user and calculate the bill according to the following rates.

First 100 Units    :  Free

Next 200 Units     :  Rs 2 per day.

Above 300 Units    :  Rs 5 per day.

Q5. Accept the number of days from the user and calculate the charge for library according to following :

First five days : Rs 2/day.

Six to ten day  : Rs 3/day.

Ten to 15 days  : Rs 4/day

After 15 days   : Rs 5/day

Q6. Accept the kilometers covered and calculate the bill according to the following criteria:

First 10 Km             Rs11/km

Next 90Km               Rs 13/km

After that              Rs15/km

Q7. Accept the marks of English, Math and Science, Social Studies Subject and display the stream allotted according to following

All Subjects more than 80 marks --      Science Stream

English >80 and Math, Science above 50 --Commerce Stream

English > 80 and Social studies > 80    --  Humanities

No comments:

Post a Comment

Most Recently Published

File Handling Test 6

 File Handling Test 6 Q1 . Do we need to use the close() function when we use 'with' statement to open a file? Q2. Which mode you wi...

CS - IP Assignment/Worksheet