-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy pathother-variable-types.py
More file actions
20 lines (17 loc) · 891 Bytes
/
other-variable-types.py
File metadata and controls
20 lines (17 loc) · 891 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
'''
Other variable types
100xp
In the previous exercise, you worked with two Python data types:
int, or integer: a number without a fractional part. savings, with the value 100, is an example of an integer.
float, or floating point: a number that has both an integer and fractional part, separated by a point. factor, with the value 1.10, is an example of a float.
Next to numerical data types, there are two other very common data types:
str, or string: a type to represent text. You can use single or double quotes to build a string.
bool, or boolean: a type to represent logical values. Can only be True or False (the capitalization is important!).
Instructions
Create a new string, desc, with the value "compound interest".
Create a new boolean, profitable, with the value True.
'''
# Create a variable desc
desc = "compound interest"
# Create a variable profitable
profitable = True