-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram1.py
More file actions
119 lines (118 loc) · 2.15 KB
/
program1.py
File metadata and controls
119 lines (118 loc) · 2.15 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
111
112
113
114
115
116
117
118
119
print("Hai", end="")
print("Aspirants")
r=200
print(r)
print("{0} are {1}!".format("YOU","ASPIRANTS",r))
print(type(r))
s="corona"
print(type(s))
s='C'
print(type(s))
a=10
b=3
print(a**b)
print(a%b)
print(a//b)
print(a/b)
#bitwise operators
## or operator
a=2
b=3
print(a|b)
## and gate
a=2
b=3
print(a&b)
##swap
a=1
b=2
temp=a
a=b
b=temp
print(a,b)
##swap without temp using xor
a=2
b=3
a=a^b
b=a^b
a=a^b
print(a,b)
##bitwise shift
a=4
b=a>>2
c=a<<2
print(b,c)
## compliment's
print(~10)
##logical operators
a=0
b=1
print(a and b)
print(a or b)
print(not b)
print(not a)
a=12
b=23
print(type(b))
print(a>b and b<a)
## Membership Operator
## "in" TRUE if a value/sequence
print("t" in 'Aspirant')
print( 'k' not in 'yup')
x=5.123467890
print(type(x) is float)
print(type(89) is not type("haiii"))
print(type("hai") is type('a'))
## Precedence in python
print(5**(1+2))
## Control Statemments
a=20
b=50
if (a>b):
print("a is bigger")
else:
print("b is bigger")
##loops
y=11
for i in range(1,y):
print(i)
c=int(input("Enter the value \n"))
print(type(c))
##assignment password making with username
print("WELCOME TO SBI\n\nPlease insert your card. ")
password=1987
choice=0
Amount=0
Money=0
for i in range(3):
pin=int(input("Enter your four digit pin"))
if pin==password:
print("pin confirmed!")
print("WHAT DO YOU WANT TO DO ?")
print("1==Balance")
print("2==Deposit")
print("3==Withdraw")
print("4==Cancel")
break
else:
print("PIN INCORRECT!!!!\n\nPlease Retry.")
if i==2:
print("Transaction Cancelled,RETRY!!")
exit()
choice=int(input("Kindly select your chocee\n"))
if choice==1:
print("Your Current Balance is 10000 rupees.")
elif choice==2:
print("Enter the amount you want to deposit")
Amount=int(input("amount ->"))
b=10000+Amount
print("THANK YOU For Your Transaction\nyour current balance is\n")
print(b)
elif choice==3:
print("Enter the amount you want to withdraw")
Money=int(input("amount to withdraw ->"))
c=10000-Money
print("THANK YOU For Your Transaction\nyour current balance is\n")
print(c)
elif choice==4:
print("TRASACTION COMPLETED\n\nYOU CAN REMOVE THE CARD")