-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlab_1.py
127 lines (71 loc) · 1.08 KB
/
lab_1.py
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
import numpy as np
x = 3
print(x)
y = "guy"
print(type(y))
print("I am a "+y+".")
z = 9
r = 33
print(z+r)
x = 1
z = 1 - 9j
n = 9.3333
e = 1.0e9
print(type(x),type(z),type(n),type(e))
x = int(9)
x_1 = int("4")
x_2 = float(4)
a = "Sup, dude"
print(a[2:4])
print(a.lower())
print(a.strip())
print(a.replace("S","L"))
print(10 %5)
print(10==5)
print(10!=5)
print(10/5)
print(10*5)
print(10**5)
list0 = ["what","is","this"]
print(list0[1])
for l in list0:
print(l)
if "dog" in list0:
print("Sure is!")
else:
print("Nope!")
p = (1,3,5.9)
print(p[0])
del p
thisset = {"a", "b", "c"}
for x in thisset:
print(x)
print("d" in thisset)
thisset.add("d")
d = {
"1":33.3,
"2":44,
"3":22.0
}
print(d)
print(d["1"])
if x == y:
print("They are equal!!!")
else:
print("they ain't equal!!!")
i = 2
while i <99:
i += 2
print(i)
if i == 44:
continue
string = "Python is awesome!!!"
for s in string:
if s == "!":
break
print(s)
def a_function(r = 4):
area = np.pi * r**2
circum = np.pi * 2*r
return (area,circum)
print(a_function(9))