Quiz Space

Python OPPE 1: September 2025, Set 1 (September 2025 term)

Question 1

+10 marksProgramming

Write a function starts_and_ends_with_same_vowel that takes a string as input and returns True if the string starts and ends with the same vowel (case insensitive), otherwise False.

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

Example

starts_and_ends_with_same_vowel("Apple") → False (starts with A and ends with e, different vowels)
starts_and_ends_with_same_vowel("Atta") → True (starts with A and ends with a, same letter and vowel)
starts_and_ends_with_same_vowel("Tart") → False (starts with T, ends with t, same letter but not vowel)
starts_and_ends_with_same_vowel("umbrella") → False (starts with u, ends with a, different vowels)

Your task

Implement this function:

def starts_and_ends_with_same_vowel(s: str) -> 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: s.

Example

Input

"Apple"

Output

False

Question 2

+10 marksProgramming

Write a function compare_last_digits(num1, num2) that takes two integers as input and checks whether they have the same last digit. Return "same" if the last digits match, otherwise return "different".

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

compare_last_digits(123, 43) -> "same" # Last digit of both is 3
compare_last_digits(56, 78) -> "different" # Last digits are 6 and 8
compare_last_digits(90, 0) -> "same" # Last digit of both is 0

Your task

Implement this function:

def compare_last_digits(num1:int, num2:int) -> str:

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: num1, num2.

Example

Input

123
43

Output

'same'

Question 3

+10 marksProgramming

Given a tuple t, write a function move_even_indices_to_end_reversed to move all elements at even indices to the end of the tuple in reversed order, while keeping the odd-indexed elements in their original order.

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

>>> t = (10, 20, 30, 40, 50)
>>> move_even_indices_to_end_reversed(t)
(20, 40, 50, 30, 10)

Explanation

even-indexed elements = (10, 30, 50)
reversed evens = (50, 30, 10)
odd-indexed elements = (20, 40)
Final output = (20, 40, 50, 30, 10)

Your task

Implement this function:

def move_even_indices_to_end_reversed(t):

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: t.

Example

Input

(10, 20, 30, 40, 50)

Output

(20, 40, 50, 30, 10)

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 Sept 2025 Set 1 paper

The IIT Madras BS Programming in Python (Python) OPPE 1 paper sat on Sept 2025, in the September 2025 term, set 1: 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 Sept 2025 Set 1 at a glance
TermSeptember 2025 term
SubjectProgramming in Python
Course codeBSCS1002
Questions7
Marks100
Duration180 min
Programming7
Official paperOPPE 1, Sep 2025 Set 1
Negative markingNo negative marking.
Updated

Other sets that day

Same OPPE 1, other subjects

More Python