-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModule_2.py
More file actions
37 lines (28 loc) · 740 Bytes
/
Copy pathModule_2.py
File metadata and controls
37 lines (28 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#Use type() to see the data type of an object
my_string = 'Upward Bound'
my_int = 87
my_float = 8.7
my_bool = True
print(type(my_string))
print(type(my_int))
print(type(my_float))
print(type(my_bool))
#Basic Arithmatic operators
num_1 = 72
num_2 = 19
print(num_1 + num_2)
print(num_1 - num_2)
print(num_1 * num_2)
print(num_1 / num_2)
print(num_1 ** num_2)
print(num_1 // num_2)
print(num_1 % num_2)
#Import math module and access functions
import math
print(math.sqrt(200))
#Import random module and access functions to get a random float and randome int
import random as r
r.seed(3743)
my_random = r.random() #Saving a random float to a variable
print(my_random)
print(r.randint(0,2)) #Printing a random int directly to terminal