You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Status/Day 1_minnie.md
+38-1Lines changed: 38 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,7 +103,25 @@ print fact(x)
103
103
print(shortFact(n))
104
104
105
105
```
106
+
-**Including Try and Except Blocks**
106
107
108
+
```python
109
+
#Solution by minnielahoti
110
+
111
+
whileTrue:
112
+
try:
113
+
num =int(input("Enter a number: "))
114
+
break
115
+
exceptValueErroras err:
116
+
print(err)
117
+
118
+
org = num
119
+
fact =1
120
+
while num:
121
+
fact = num * fact
122
+
num = num -1
123
+
124
+
print(f'the factorial of {org} is {fact}')
107
125
---
108
126
109
127
# Question 3
@@ -155,12 +173,31 @@ n = int(input())
155
173
ans={i : i*i for i inrange(1,n+1)}
156
174
print(ans)
157
175
```
176
+
-**Including Try and Except Blocks**
158
177
178
+
```python
179
+
#Solution by minnielahoti
180
+
181
+
whileTrue:
182
+
try:
183
+
num =int(input("Enter a number: "))
184
+
break
185
+
exceptValueErroras err:
186
+
print(err)
187
+
188
+
dictio =dict()
189
+
for item inrange(num+1):
190
+
if item ==0:
191
+
continue
192
+
else:
193
+
dictio[item] = item * item
194
+
195
+
print(dictio)
159
196
---
160
197
161
198
## Conclusion
162
199
163
-
**_These was the solved problems of day 1. The above problems are very easy for the basic syntex learners.I have shown some easy ways of coding in my solutions. Lets see how to face and attack new problems in the next day._**
200
+
**_These were the solved problems of day 1. The above problems are very easy for the basic syntex learners.I have shown some easy ways of coding in my solutions. Lets see how to face and attack new problems in the next day._**
164
201
165
202
[**_go to next day_**](https://github.com/darkprinx/100-plus-Python-programming-exercises-extended/blob/master/Status/Day%202.md "Next Day")
0 commit comments