怎样用python编程,把一个字符串中某个特定字符大写。
发布网友
发布时间:2022-05-24 23:11
我来回答
共3个回答
热心网友
时间:2023-09-24 09:41
owel = ['a','e','i','o','u']
s = 'hello world'
for i in s:
if i in owel:
s2 = s2 + i.capitalize()
else:
s2 = s2 +i
print(s2)
热心网友
时间:2023-09-24 09:41
str = 'haelilouuuuuu'
list_vowel = 'a,e,i,o,u'
list = []
for word in str:
if word in list_vowel:
word.upper()
list.append(word)
print(''.join(list))
热心网友
时间:2023-09-24 09:42
import string
'hello world'.translate(string.maketrans('aeiou', 'AEIOU'))