Commit c172c569 authored by Sai Mounika's avatar Sai Mounika

Update day1:change_occurrence_of_letter.py

parent ac11c355
a='restart'
b=list(a)
c=len(b)
i=0
while (i<c-1):
j=i+1
while (j<c-1):
if b[i]==b[j])
b.remove(a[j])
b.insert(j,"$")
j=j+1
"".joina()
print a
#output:resta$t
\ No newline at end of file
a=raw_input("enter a string")
b=a.replace(a[0],'$')
c=b.replace(b[0],a[0],1)
print c
"""output:
enter a string restart
resta$t
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment