<reponame>CodedLadiesInnovateTech/-python-challenge-solutions<gh_stars>1-10
"""
Write a Python program to create a new string with no duplicate consecutive letters from a given string.
"""
def no_consecutive_letters (txt):
    return txt[0] + ''.join(txt[i] for i in range(1,len(txt)) if txt[i] != txt[i-1])

print(no_consecutive_letters("PPYYYTTHON"))
print(no_consecutive_letters("PPyyythonnn"))
print(no_consecutive_letters("Java"))
print(no_consecutive_letters("PPPHHHPPP")) 
"""
Write a Python program to create a new string with no duplicate consecutive letters from a given string.
"""
def no_consecutive_letters (txt):
    return txt[0] + ''.join(txt[i] for i in range(1,len(txt)) if txt[i] != txt[i-1])

print(no_consecutive_letters("PPYYYTTHON"))
print(no_consecutive_letters("PPyyythonnn"))
print(no_consecutive_letters("Java"))
print(no_consecutive_letters("PPPHHHPPP"))
Write a Python program to create a new string with no duplicate consecutive letters from a given string.