-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquestion.py
More file actions
113 lines (79 loc) · 1.75 KB
/
Copy pathquestion.py
File metadata and controls
113 lines (79 loc) · 1.75 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#1 accept number from a user
#ask for a number
"""num = input("please provide a number-")
print(num)"""
### if you have a string and inside that string you have integer
#then you can use the int() function
#and if you have a string and inside that string you havebdecimaln
#or fraction values you should use float() functions
"""a = 12
a = float(a)
print(a)
#boolean
a = 12
b = 67
c = 0
d = ""
e = 0.0
f ="hello"
print(bool(a))
print(bool(b))
print(bool(c))
print(bool(d))
print(bool(e))
print(bool(f))
####falsy value
#1--0
#2--false
#3--0.0
#4--""
#5-[]
#6()
#7{}
##These all above value are falsy value they always give you false result
name= "Harsh"
age = 24
print("my name is ",name,"and your age is", age)
print(f"my is {hash} and your age is {age}")
name = input("please tell ypur name")
age = int(input ("now tell your age is"))
print(f"your name is{name} and your age is {age}")"""
### operator
#arithmetic opearator(+,-,/,*,//,**,%)
#logical operator
#comparision operator
#logical operator
## // --- floor division
a = 12
b = 34
print( a+ b)
print( a* b)
a = 12.5
b = 6
print(a + b)
a = 12
b =5
print(a/b)
print(a // b)
a = 11
b = 5
print(34** 2)
##mod
a = 3
b = 2
print( a% b)
# BODMAS - bracke of division multiplication addition substraction
print((10 + 20)*2)
##SIMPLE INTEREST
p = float(input( "tell your principal amount:"))
r = float(input( "tell your rate of interest:"))
t = float(input( "tell your time in year:"))
SI = (p*r*t)/100
print(f"your simple interst will be{SI}")
## compound interest
##formula = p(1 + R/100)**T
p = float(input("tell your principal amount:"))
R = float(input("tell your rate of interest:"))
T = float(input("tell your time in years:"))
CI = p*(1 + R/100)**T
print(f"your compound interest will be{CI -p }")