Computer Science

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/10

flashcard set

Earn XP

Description and Tags

Modules

11 Terms

1
New cards

What is a Python Module

It is a file with a .py extension which contains some variables and constants, module functions, objects etc. defined in it, which can be used in other python programs.

2
New cards

How to use modules?

You can import modules using the import statement, allowing access to its functions and variables in your program.

3
New cards

What is Python’s standard library? With examples

A collection of many modules for different functionalities. Examples: module time offers time related functions, module string offers functions for string manipulation etc.

4
New cards

math.ceil, math.floor, math.sqrt

round up, round down, square root

5
New cards

math.exp, math.fabs, math.log(num,[base]). Explain two log cases.

e^<argument>, absolute value (magnitude), natural logarithm which takes ½ arguments. If 1 argument, gives natural log value, if two arguments, base^num.

6
New cards

math.log10 What happens when no argument and negative number is given? math.pow what happens when base is zero or when exp is not an int or negative?

log with base ten. range error, domain error
2 args, (base,power), domain error

7
New cards

math.sin, math.cos, math,tan. Condition for arguments.

sin,cos and tan values. Arguments should be a number. Arguments should be in radians. else, typeerror.

8
New cards

math.degrees, math.radians

radian to degrees, degrees to radian.

9
New cards
10
New cards
11
New cards