File tree Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -21,13 +21,13 @@ for i in li:
21
21
----------------
22
22
** My Solution: Python 3**
23
23
``` python
24
- # to be written
25
-
24
+ data = [2 ,4 ,5 ,6 ]
25
+ for i in data:
26
+ assert i% 2 == 0 , " {} is not an even number" .format(i)
26
27
```
27
28
---------------------
28
29
29
30
30
-
31
31
# Question 66
32
32
33
33
### ** Question**
@@ -58,8 +58,9 @@ print eval(expression)
58
58
----------------
59
59
** My Solution: Python 3**
60
60
``` python
61
- # to be written
62
-
61
+ expression = input ()
62
+ ans = eval (expression)
63
+ print (ans)
63
64
```
64
65
---------------------
65
66
@@ -111,7 +112,7 @@ print bin_search(li,12)
111
112
112
113
### ** Question**
113
114
114
- > *** Please generate a random float where the value is between 10 and 100 using Python math module.***
115
+ > *** Please generate a random float where the value is between 10 and 100 using Python module.***
115
116
116
117
----------------------
117
118
### Hints
@@ -123,13 +124,13 @@ print bin_search(li,12)
123
124
``` python
124
125
import random
125
126
print random.random()* 100
126
-
127
127
```
128
128
----------------
129
129
** My Solution: Python 3**
130
130
``` python
131
- # to be written
132
-
131
+ import random
132
+ rand_num = random.uniform(10 ,100 )
133
+ print (rand_num)
133
134
```
134
135
---------------------
135
136
@@ -139,7 +140,7 @@ print random.random()*100
139
140
140
141
### ** Question**
141
142
142
- > *** Please generate a random float where the value is between 5 and 95 using Python math module.***
143
+ > *** Please generate a random float where the value is between 5 and 95 using Python module.***
143
144
144
145
145
146
----------------------
@@ -156,8 +157,9 @@ print random.random()*100-5
156
157
----------------
157
158
** My Solution: Python 3**
158
159
``` python
159
- # to be written
160
-
160
+ import random
161
+ rand_num = random.uniform(5 ,95 )
162
+ print (rand_num)
161
163
```
162
164
---------------------
163
165
You can’t perform that action at this time.
0 commit comments