first group of challenges
This commit is contained in:
2
challenges27-34/challenge-027.py
Normal file
2
challenges27-34/challenge-027.py
Normal file
@@ -0,0 +1,2 @@
|
||||
number = float(input('Enter number with lots of decimal number : '))
|
||||
print(number*2)
|
3
challenges27-34/challenge-028.py
Normal file
3
challenges27-34/challenge-028.py
Normal file
@@ -0,0 +1,3 @@
|
||||
number = float(input('Enter number with lots of decimal number : '))
|
||||
print(round(number*2, 2))
|
||||
|
4
challenges27-34/challenge-029.py
Normal file
4
challenges27-34/challenge-029.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import math
|
||||
|
||||
number = int(input('Enter number over 500 : '))
|
||||
print(round(math.sqrt(number)))
|
3
challenges27-34/challenge-030.py
Normal file
3
challenges27-34/challenge-030.py
Normal file
@@ -0,0 +1,3 @@
|
||||
import math
|
||||
|
||||
print(round(math.pi, 5))
|
5
challenges27-34/challenge-031.py
Normal file
5
challenges27-34/challenge-031.py
Normal file
@@ -0,0 +1,5 @@
|
||||
import math
|
||||
|
||||
radius = float(input('Enter circle radius : '))
|
||||
area = math.pi * (radius**2)
|
||||
print(area)
|
7
challenges27-34/challenge-032.py
Normal file
7
challenges27-34/challenge-032.py
Normal file
@@ -0,0 +1,7 @@
|
||||
import math
|
||||
|
||||
radius = float(input('Enter cylinder radius : '))
|
||||
depth = float(input('Enter cylinder depth : '))
|
||||
area = math.pi * (radius**2)
|
||||
volume = area * depth
|
||||
print(round(volume, 3))
|
3
challenges27-34/challenge-033.py
Normal file
3
challenges27-34/challenge-033.py
Normal file
@@ -0,0 +1,3 @@
|
||||
number_1 = int(input('Enter 1st number : '))
|
||||
number_2 = int(input('Enter 2nd number : '))
|
||||
print('{0} divided by {1} is {2} with reminder {3}'.format(number_1, number_2, number_1//number_2, number_1%number_2))
|
15
challenges27-34/challenge-034.py
Normal file
15
challenges27-34/challenge-034.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import math
|
||||
|
||||
print('1) Square\n2) Triangle')
|
||||
choose = int(input('Enter a number : '))
|
||||
if choose == 1:
|
||||
square = int(input('Enter square length side : '))
|
||||
area = square*square
|
||||
print('Square area is {0}'.format(area))
|
||||
elif choose == 2:
|
||||
base = int(input('Enter triangle base : '))
|
||||
height = int(input('Enter triangle height : '))
|
||||
area = (base/2)*height
|
||||
print('Triangle area is {0}'.format(area))
|
||||
else:
|
||||
print('Wrong choose')
|
Reference in New Issue
Block a user