Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
deleted 2 characters in body
Source Link
Nf4r
  • 1.4k
  • 1
  • 8
  • 9

Just use the end parameter in print function. (I assumed that you are using python 3.x, with print being a function)

def translate(string): vowels=['a','e','i','o','u'] for letter in string: if letter in vowels: print(letter, end=' 'end='') else: print(letter+'o'+letter, end=' 'end='') print(translate('this is fun')) 

Just use the end parameter in print function. (I assumed that you are using python 3.x, with print being a function)

def translate(string): vowels=['a','e','i','o','u'] for letter in string: if letter in vowels: print(letter, end=' ') else: print(letter+'o'+letter, end=' ') print(translate('this is fun')) 

Just use the end parameter in print function. (I assumed that you are using python 3.x, with print being a function)

def translate(string): vowels=['a','e','i','o','u'] for letter in string: if letter in vowels: print(letter, end='') else: print(letter+'o'+letter, end='') print(translate('this is fun')) 
Source Link
Nf4r
  • 1.4k
  • 1
  • 8
  • 9

Just use the end parameter in print function. (I assumed that you are using python 3.x, with print being a function)

def translate(string): vowels=['a','e','i','o','u'] for letter in string: if letter in vowels: print(letter, end=' ') else: print(letter+'o'+letter, end=' ') print(translate('this is fun'))