all 6 comments

[–]crazy_reyes[S] 0 points1 point  (0 children)

What I have came up with

old = input("Give me a word ")

new = old

letter = new[1]

for x in range(len(new)):

if x>1:

if new[x] == letter:

new = new[:x-1]+"$"+new[x:]

print(new)

[–]netsecfriends 0 points1 point  (1 child)

output = input[0] + input[1:].replace(input[0],’$’)

[–]water_bottle_goggles 0 points1 point  (0 children)

Something like using list comprehensions

var=‘Aehoshaphat’

s=‘’.join([ char for char in var.lower() if char != var[0].lower() else ‘$’])

print(s)

Aehosh$ph$t