Quiz Space

Programming in Python OPPE 1: January 2026, Set 4 (January 2026 term)

Question 1

+10 marksProgramming

The string temp is a number followed by a letter for the unit: C for degrees Celsius or K for kelvin, like "10C" or "290K". Write a function classify_temperature(temp) that changes kelvin to degrees Celsius by subtracting 273.15, and returns "Cold" if the temperature in Celsius is below 15, "Moderate" if it is from 15 to 30 (both included), and "Hot" if it is above 30.

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

classify_temperature("10C") -> 'Cold'
classify_temperature("290K") -> 'Moderate'

Your task

Implement this function:

def classify_temperature(temp: str) -> 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: temp.

Example

Input

"10C"

Output

'Cold'

Question 2

+10 marksProgramming

Write a function is_case_insensitive_strict_prefix(a, b) that returns True if one of the two non-empty strings is the beginning of the other one and they are not the same, without regard to upper or lower case. Otherwise it returns False.

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_case_insensitive_strict_prefix("app", "apple") -> True
is_case_insensitive_strict_prefix("App", "APPLE") -> True

Your task

Implement this function:

def is_case_insensitive_strict_prefix(a: str, b: 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: a, b.

Example

Input

"app"
"apple"

Output

True

Question 3

+10 marksProgramming

Write a function describe_number that takes an integer as input and returns:

"Fizz" if the number is divisible by 3.
"Buzz" if divisible by 5.
"FizzBuzz" if divisible by both 3 and 5.
"Normal" if it is divisible by neither.

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

describe_number(9) -> "Fizz"
describe_number(10) -> "Buzz"
describe_number(15) -> "FizzBuzz"
describe_number(7) -> "Normal"

Your task

Implement this function:

def describe_number(num: 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: num.

Example

Input

9

Output

'Fizz'

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 Jan 2026 Set 4 paper

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

Other sets that day

Same OPPE 1, other subjects

More Python