Important Notice:

M3-R5.1 Assignment — Functions & Modules (Chapter 10 & 12)

8 Questions M3-R5.1

Assignment for M3-R5.1 covering Python Functions and Modules.

1
A function that calls itself is called?
1 Mark
  • A Nested function
  • B Recursive function
  • C Lambda function
  • D Built-in function
2
Which module provides mathematical operations in Python?
1 Mark
  • A sys
  • B math
  • C os
  • D time
3
What is **kwargs in Python?
1 Mark
  • A Variable positional arguments
  • B Variable keyword arguments
  • C Default argument
  • D Required argument
4
How do you import only the sqrt function from math?
1 Mark
  • A import math.sqrt
  • B from math import sqrt
  • C import sqrt from math
  • D get math.sqrt
5
What does datetime.now() return?
1 Mark
  • A Current date only
  • B Current time only
  • C Current date and time
  • D Unix timestamp
6
A local variable inside a function?
1 Mark
  • A Can be accessed globally
  • B Cannot be accessed outside the function
  • C Is permanent
  • D Same as a class variable
7
Which built-in function returns an absolute value?
1 Mark
  • A abs()
  • B mod()
  • C positive()
  • D sqrt()
8
os.getcwd() in Python returns?
1 Mark
  • A File size
  • B Current working directory
  • C OS version
  • D System RAM
Actions
Back to Assignments
Paper Info
  • Total Questions: 8
  • Total Marks: 8
  • Time: 16 min
  • Subject: M3-R5.1