#P1170. 替换列表元素
替换列表元素
题目描述
读入列表,把列表中的nihao,替换为hello。
输入
第一行输入一个数字n,表示列表中共有n个元素。()
第二行,输入n个字符串,中间用空格分隔。
输出
把列表中的nihao,替换为hello,然后以列表的形式输出。
提示:字符串不是数字,不可以用int(input())进行输入
样例
5
h he hel hell nihao
['h', 'he', 'hel', 'hell', 'hello']
读入列表,把列表中的nihao,替换为hello。
第一行输入一个数字n,表示列表中共有n个元素。(2≤n≤20)
第二行,输入n个字符串,中间用空格分隔。
把列表中的nihao,替换为hello,然后以列表的形式输出。
提示:字符串不是数字,不可以用int(input())进行输入
5
h he hel hell nihao
['h', 'he', 'hel', 'hell', 'hello']