Podcast
Questions and Answers
What does the pass
statement do in a for
loop during iteration?
What does the pass
statement do in a for
loop during iteration?
Which statement correctly calculates the total amount after reducing a price by 25%?
Which statement correctly calculates the total amount after reducing a price by 25%?
In sorting a list of people by age, what should be done if two people share the same age?
In sorting a list of people by age, what should be done if two people share the same age?
What is the effect of the continue
statement in a loop that iterates through a list of strings?
What is the effect of the continue
statement in a loop that iterates through a list of strings?
Signup and view all the answers
What data should be collected for each person in the directory program?
What data should be collected for each person in the directory program?
Signup and view all the answers
Study Notes
Python Intermediate Exam - October 2023 (CRBS)
- Question Paper Code: QPCB12
- Total Marks: 100
- Total Time: 3 hours
Section A (Marks: 15 x 2 = 30)
-
Question 1: Write a program using a
for
loop that prints numbers 1 to 10. Use apass
statement to do nothing for numbers 3 and 7. -
Question 2: Create a program that iterates through a list of strings. Use a
continue
statement to skip any string containing the letter 'a'.
Section B (Marks: 30)
- Question 3: Develop a program for a restaurant. Users input item prices. Calculate the total amount after a 25% discount.
Section C (Marks: 40)
-
Question 4: Build a directory of information about N people. User input required for N, names, ages, and sex for each person.
- Sort ages in ascending order.
- Names should be printed accordingly, with the youngest first.
- If two people have the same age, print in the input order.
- Constraints: 2 ≤ N ≤ 9
-
Sample Input: Number of people, followed by name, age, sex for each person. Example:
John, Doe, 25, Male
. -
Sample Output: Sorted names by age, followed by age and sex in parenthesis. Output should look similar to
Bob Brown (20, Male)
.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Related Documents
Description
Test your knowledge with this Intermediate Python exam focused on loops, list iteration, and user input handling. It covers topics such as using control statements and organizing data structures efficiently. Perfect for students looking to assess their understanding of Python concepts.