Topic 6 - Session 6 - MTA Intro Course Flashcards

1
Q

What will be the value of the variable “upperbound” in the code example below?

upperbound = math.ceil(44.4)

A

The function will round the value up to 45.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What will be the value of the variable “lowerbound” in the code example below?

lowerbound = math.floor(44.4)

A

The function will round down to 44.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What python module is required when working with files?

A

import io

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What python module is required when you need to display system information?

A

import sys

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Provide one example of why the sys module would be useless to use in an application

A

The module could be used to display error messages.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which python module is required if you wish to create a folder on a local machine?

A

import os

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which module is required to generate a random integer in python?

A

from random import randint

How well did you know this?
1
Not at all
2
3
4
5
Perfectly