Skip to content

Commit 625fa7c

Browse files
Exercise_12
1 parent 3a9f7aa commit 625fa7c

File tree

3 files changed

+38
-14
lines changed

3 files changed

+38
-14
lines changed

.idea/workspace.xml

Lines changed: 14 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,10 +328,25 @@ print ",".join(values)
328328
## Question_11: ##
329329
**Description:**
330330
Write a Python program to get the Python version you are using
331-
332-
331+
**Solution_2:**
333332
```python
334333
import sys
334+
str_ = str(sys.version_info[0]) + "." + str(sys.version_info[1]) + "." + str(sys.version_info[2])
335+
print("Python version: " + str_)
336+
# or simple
335337
print(sys.version_info)
336338
```
337339
* * *
340+
341+
## Question_12: ##
342+
**Description:**
343+
Write a Python program which accepts the radius of a circle from the user and compute the area.
344+
**Solution_2:**
345+
```python
346+
import math
347+
def prog_7():
348+
radius = int(input())
349+
print("Area for radius: " + str(radius) + " is " + str(math.pi * math.pow(radius, 2)))
350+
prog_7()
351+
```
352+
* * *

Solution.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import sys
2-
2+
import math
33

44
# ========================= Question_1: ===========================================
55
# Write a program which will find all such numbers which are divisible by 7 but
@@ -256,7 +256,11 @@ def prog_6():
256256
# or simple
257257
print(sys.version_info)
258258

259+
# ========================= Question_12: ===========================================
260+
# Write a Python program which accepts the radius of a circle from the user and compute the area.
259261

260-
261-
262+
def prog_7():
263+
radius = int(input())
264+
print("Area for radius: " + str(radius) + " is " + str(math.pi * math.pow(radius, 2)))
265+
prog_7()
262266
print("=============================================")

0 commit comments

Comments
 (0)