2024 Sep OPPE 1 - Set 1¶
Sum of Squares and Abs Diff
Return a tuple of the sum and absolute difference of squares of two numbers. Covers abs() and tuple returns.
Is Odd-Length Palindrome
Check if a string is both a palindrome and odd-length. Covers s == s[::-1] and short-circuit and.
Remove Elements at Two Indices
Remove two elements from a list in-place by index. Covers the larger-index-first rule and del vs pop().
Sum of Squares of Even Numbers
Filter even numbers, square each, and sum. Covers generator expressions and the filter+map+sum pipeline.
SolvedUppercase Only Vowels
Convert vowels to uppercase and all other characters to lowercase. Full I/O problem covering str.translate().
Student Marks Filter
Filter roll numbers by five criteria - above average, below average, fail, toppers, all. Covers lambda dispatch dicts and closure over average.
SolvedV Pattern
Print a V-shape using \ and /. Full I/O pattern printing - covers the inner-space formula and backslash escaping.