File tree Expand file tree Collapse file tree 1 file changed +39
-2
lines changed Expand file tree Collapse file tree 1 file changed +39
-2
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,25 @@ print fact(x)
103103 print (shortFact(n))
104104
105105 ```
106-
106+ ---
107+ ``` python
108+ ''' Solution by: minnielahoti
109+ '''
110+
111+ while True :
112+ try :
113+ num = int (input (" Enter a number: " ))
114+ break
115+ except ValueError as err:
116+ print (err)
117+
118+ org = num
119+ fact = 1
120+ while num:
121+ fact = num * fact
122+ num = num - 1
123+ print (f ' the factorial of { org} is { fact} ' )
124+ ```
107125---
108126
109127# Question 3
@@ -155,7 +173,26 @@ n = int(input())
155173ans= {i : i* i for i in range (1 ,n+ 1 )}
156174print (ans)
157175```
158-
176+ ---
177+ ``` python
178+ ''' Solution by: minnielahoti
179+ '''
180+
181+ while True :
182+ try :
183+ num = int (input (" Enter a number: " ))
184+ break
185+ except ValueError as err:
186+ print (err)
187+
188+ dictio = dict ()
189+ for item in range (num+ 1 ):
190+ if item == 0 :
191+ continue
192+ else :
193+ dictio[item] = item * item
194+ print (dictio)
195+ ```
159196---
160197
161198## Conclusion
You can’t perform that action at this time.
0 commit comments