Onversions Flashcards
1
Q
Functions are used to convert Data types
A
Functions are used to convert Data types
2
Q
Inputs from the user are strings
A
Inputs from the user are strings
3
Q
int(s)
A
Converts a string (s) to an integer
4
Q
float(s)
A
Converts a string (s) to a number with a decimal point
5
Q
str (x)
A
Converts an integer or floating point number (x) to a string
6
Q
bool(s)
A
Converts a string (e.g. “True”) to a Boolean
7
Q
ord()
A
converts a character into its numerical ASCII value.
8
Q
chr()
A
converts a numerical ASCII value back into its corresponding character.