Skip to content

Commit f49bffa

Browse files
authored
Attempted solution to the first question
1 parent 624beea commit f49bffa

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

first.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
a = 10
2+
b = 20
3+
print('Initially')
4+
print("a =",a,",","b =",b,'\n')
5+
temp=a
6+
a=b
7+
b=temp
8+
print("After interchanging")
9+
print("a =",a,",","b =",b,'\n')
10+
11+
12+
13+
print('Another method')
14+
a = 10
15+
b = 20
16+
a = a + b
17+
b = a - b
18+
a = a - b
19+
print("a =",a,",",'b =',b,'\n')
20+
21+
22+
print('Yet another method')
23+
a = a ^ b
24+
b = b ^ a
25+
a = a ^ b
26+
print('a =',a,',','b =',b)

0 commit comments

Comments
 (0)