Skip to content

Commit 127ad69

Browse files
authored
Merge pull request #9 from prathimacode-hub/main
Added string swap program
2 parents 1e6a0fb + f4b19d5 commit 127ad69

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
s=input()
2+
s=list(s)
3+
res=""
4+
for i in range(0,len(s)-1,2):
5+
temp=s[i+1]
6+
s[i+1]=s[i]
7+
s[i]=temp
8+
print(res.join(s))

0 commit comments

Comments
 (0)