-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprograms.py
More file actions
92 lines (51 loc) · 1.58 KB
/
Copy pathprograms.py
File metadata and controls
92 lines (51 loc) · 1.58 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
# Find ASCII Value of a character 'X' and 'x'
ch = input("Enter any character: ")
print("The ASCII value of char " + ch + " is: ",ord(ch))
# Write Program to Compute Quotient and Remainder
divisor = 5
dividend = 27
quotient = dividend//divisor
reminder = dividend % divisor
print("Quotient is", quotient)
print("Reminder is",reminder)
# Swap two numbers using temporary variable
x = 10
y = 50
# Creating a temp variable
temp = x
x = y
y = temp
print("Value of x:", x)
print("Value of y:", y)
#Write Program to Check Whether a Number is Even or Odd - 88,37,1658
x=88371658
if (x % 2) == 0 :
print("Number is Even ",x)
else :
print("Number is Odd ",x)
#Check whether an alphabet is vowel or consonant using if..else statement - a,b,e,o
x='a'
if x in ('a','e','i','o','u') :
print("The given Alphabet is vowel",x)
else :
print("The given Alphabet is consonant",x)
#Write Programm to calculate GST i.e. 18% on base price 34900/-
gst = ((18/100) * 34900)
print("gst is ",gst)
#17) Write programm to calculate monthly simple intrest and compound intrest(5%/Month) on amount - 161258/-
p=161258
r=5
t=1
si=p*r*t*0.01
print("Si : ",si)
Amount = p * (pow((1 + r / 100), t))
ci = Amount - p
print("Compound interest is", ci)
#Write programm to calculate monthly simple intrest and compound intrest(5%/Month) on amount - 161258/-
a=161258
e3=a/36
e5=a/60
emi3=e3+(0.05*e3)
emi5=e5+(0.05*e5)
print("EMI for 3 years with intrest 5%",emi3)
print("EMI for 5 years with intrest 5%",emi5)