Python 函数:格式化城市和国家名称
def format_city(city, country): return f'{city.title()}, {country.title()}'
示例
print(format_city('santiago', 'chile')) # 输出 Santiago, Chile
原文地址: https://www.cveoy.top/t/topic/oUoW 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
def format_city(city, country): return f'{city.title()}, {country.title()}'
原文地址: https://www.cveoy.top/t/topic/oUoW 著作权归作者所有。请勿转载和采集!