The first maketrans arguments must have equal length

string = input("Input:")

# Remove using trans()

remove_string =string.translate(str.maketrans(',' , 'aeiouAEIOU'))

print(f"Ouput:{remove_string}")

i getting above error,help please.

i am solving cs50p problem set, , implement a program that prompts the user for a str of text and then outputs that same text but with all vowels (A, E, I, O, and U) omitted, whether inputted in uppercase or lowercase. This is the question but i couldn’t identify where it went wrong

I want to remove vowels from my output. if I input twitter it should be remove vowels and gave output without i and e, without any casesensitivity

i tried with loop but i couldn’t get remove method, #print(str.translate({ord(letter): None for letter in ‘aeiou’}))
method worked but when it comes to case it will give trouble, hence i changed my code like above and it doesnt work as expected. i got confused, i am very new to programming.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.