Skip to content

Commit

Permalink
Merge pull request #619 from pooja21082001/master
Browse files Browse the repository at this point in the history
Update strRev.py
  • Loading branch information
SK7here authored Oct 26, 2019
2 parents d67f354 + 0619e1f commit 307a9c0
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion Algorithms/String/StringReverse/strRev.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,19 @@

x=a[::-1]
s=s.replace(a,x)
print(s)
print(s)

#Method 3
def reverse(s):
str = ""
for i in s:
str = i + str
return str

s = "programming is fun"

print ("The original string is : ",end="")
print (s)

print ("The reversed string(using loops) is : ",end="")
print (reverse(s))

0 comments on commit 307a9c0

Please sign in to comment.