forked from rohitash-chandra/python-bootcamp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic.py
More file actions
43 lines (24 loc) · 802 Bytes
/
Copy pathbasic.py
File metadata and controls
43 lines (24 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
number = 6677 # integer
number_decimal = 18.6 #cpp or java double or float
height = 1.8
name = ' Rohitash Chandra' # string
print(number)
print(number, ' is number')
print(number_decimal, ' is decimal ')
print(height,' is height ')
print(name)
print(name, ' is my name')
print(' lets calculate')
radius = 12.25
pi = 3.14
area_circle = pi * radius * radius
print(area_circle, ' is area of the circle')
# triangle (ask the user for input)
print('Good day mate. This program claculates area of triangle')
print('please enter the base: ')
base = input()
print('please enter the height: ')
height = input()
print(base, height, ' are the base and height, respectively')
area_triangle = 0.5 * int(base) * int(height)
print(area_triangle, ' is the area of the triangle')