Skip to content

Commit b816bcc

Browse files
committed
day 17 code is updated without the binary search one
1 parent a6a0ba2 commit b816bcc

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

Status/Day_17.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ for i in li:
2121
----------------
2222
**My Solution: Python 3**
2323
```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)
2627
```
2728
---------------------
2829

2930

30-
3131
# Question 66
3232

3333
### **Question**
@@ -58,8 +58,9 @@ print eval(expression)
5858
----------------
5959
**My Solution: Python 3**
6060
```python
61-
#to be written
62-
61+
expression = input()
62+
ans = eval(expression)
63+
print(ans)
6364
```
6465
---------------------
6566

@@ -111,7 +112,7 @@ print bin_search(li,12)
111112

112113
### **Question**
113114

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.***
115116
116117
----------------------
117118
### Hints
@@ -123,13 +124,13 @@ print bin_search(li,12)
123124
```python
124125
import random
125126
print random.random()*100
126-
127127
```
128128
----------------
129129
**My Solution: Python 3**
130130
```python
131-
#to be written
132-
131+
import random
132+
rand_num = random.uniform(10,100)
133+
print(rand_num)
133134
```
134135
---------------------
135136

@@ -139,7 +140,7 @@ print random.random()*100
139140

140141
### **Question**
141142

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.***
143144
144145

145146
----------------------
@@ -156,8 +157,9 @@ print random.random()*100-5
156157
----------------
157158
**My Solution: Python 3**
158159
```python
159-
#to be written
160-
160+
import random
161+
rand_num = random.uniform(5,95)
162+
print(rand_num)
161163
```
162164
---------------------
163165

0 commit comments

Comments
 (0)