Quiz Space

Programming in Python OPPE 1: May 2026, Set 3 (May 2026 term)

Question 1

+10 marksProgramming

Write a function is_tens_digit_greater(num) that takes a positive two-digit integer and returns True if its tens digit is strictly greater than its ones digit, and False otherwise.

NOTE: This is a function type question, you don't have to take input or print the output, just have to complete the required function definition.

Example

is_tens_digit_greater(54) -> True
is_tens_digit_greater(33) -> False

Your task

Implement this function:

def is_tens_digit_greater(num: int) -> bool:

Write the function only — the arguments are read for you and the return value is printed automatically.

Arguments arrive as one Python literal per line, in this order: num.

Example

Input

54

Output

True

Question 2

+10 marksProgramming

Write a function has_common_integer(a, b) that takes two sets of integers and returns True if at least one integer is in both sets, and False otherwise.

NOTE: This is a function type question, you don't have to take input or print the output, just have to complete the required function definition.

Example

has_common_integer({1, 2, 3}, {3, 4, 5}) -> True
has_common_integer({10, 20}, {30, 40}) -> False

Your task

Implement this function:

def has_common_integer(a: set, b: set) -> bool:

Write the function only — the arguments are read for you and the return value is printed automatically.

Arguments arrive as one Python literal per line, in this order: a, b.

Example

Input

{1, 2, 3}
{3, 4, 5}

Output

True

Question 3

+10 marksProgramming

Write a function shuffle_digits(num) that takes a positive 4-digit integer and returns the integer made of its digits in the order 2nd, 4th, 1st, 3rd. For example, the digits of 1234 are used in the order 2, 4, 1, 3, which gives 2413. If the result starts with zeros, they are not shown, as for any integer.

NOTE: This is a function type question, you don't have to take input or print the output, just have to complete the required function definition.

Example

shuffle_digits(1234) -> 2413
shuffle_digits(2413) -> 4321

Your task

Implement this function:

def shuffle_digits(num: int) -> int:

Write the function only — the arguments are read for you and the return value is printed automatically.

Arguments arrive as one Python literal per line, in this order: num.

Example

Input

1234

Output

2413

4 more questions in this paper

Sign in with Google — it is free — to see every question with its answer and explanation, practise it in learning mode, or take it as a timed mock test.

More on the Python OPPE 1 May 2026 Set 3 paper

The IIT Madras BS Programming in Python (Python) OPPE 1 paper sat on May 2026, in the May 2026 term (T2 2026), set 3: 7 questions for 100 marks in 180 minutes. The first 3 questions are below. Sign in with Google — it is free — to see the whole paper with its answers and explanations, in learning mode or as a timed mock test.

FeaturePython OPPE 1 May 2026 Set 3 at a glance
TermMay 2026 term (T2 2026)
SubjectProgramming in Python
Course codeBSCS1002
Questions7
Marks100
Duration180 min
Programming7
Official paperOPPE 1, May 2026 Set 3
Negative markingNo negative marking.
Updated

Other sets that day

Same OPPE 1, other subjects

More Python