Skip to content

Commit 74a0045

Browse files
committed
2.Calculate the Area of circle
1 parent f2424cc commit 74a0045

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

300_Exercises/Simple/1.numbers_and_squares.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Python to find the range of numbers that are squares within a specified limit
1+
# 1.Python to find the range of numbers that are squares within a specified limit
22
# method 1
33
print('Numbers\t\tSquares')
44
print('1 \t\t '+str(1*1))
@@ -23,7 +23,7 @@ def number_squares(start_num,end_num):
2323
print("Invalid input! Please enter two integers separated by a space.")
2424

2525

26-
# Assignment
26+
# Assignment 1:
2727
# In Python to find the range of numbers that are both squares and cubes within a specified limit
2828
def number_square_cubes(start_num,end_num):
2929
if start_num>end_num:
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# 2.Calculate the Area of circle
2+
# Method 1:
3+
def area_of_circle(n):
4+
print(f'Area of the circle {n} is {3.14*n*n}')
5+
6+
n = float(input('Enter the n Number: '))
7+
area_of_circle(n)
8+
9+
10+
# method 2:
11+
import math
12+
13+
def area_of_circe(n):
14+
print(f'Area of the circle {n} is {math.pi*n**2}')
15+
16+
n = float(input('Enter the n Number: '))
17+
area_of_circe(n)

0 commit comments

Comments
 (0)