以下程序执行结果是________。 string = ["PHP", "Python", "C", "C++", "Java"] for item in string: item_temp = item.lower() for i in range(len(item)): if item_temp[i] in 'aeiou': string.remove(item) break print(string) s = sorted(string, reverse = True) print(s)[/i]
['PHP', 'C', 'C++'] ['PHP', 'C++', 'C']###['PHP','C','C++'] ['PHP','C++','C']
举一反三
- 下面程序的运行结果是(). void delch(char *s) { int i,j; char *a; a=s; for(i=0,j=0;a[i]!='\0';i++) if(a[i]>='0'&&a[i]<='9') {s[j]=a[i];j++;} s[j]='\0'; } main() { char *item="a34bc"; delch(item); printf("\n%s",item); }
- 程序运行结果为(______ )fruit = ['apple', 'banana', 'mango', 0]for item in fruit: if item == 0: fruit[item] = 'watermelon' elif item == 'mango': fruit[2] = 'pear'print(fruit)
- 以下类方法定义正确的是() A: class Student: fav=("唱歌","跳舞","绘画") def showFav(cls): for item in cls.fav: print(item) B: class Student: fav=("唱歌","跳舞","绘画") @classmethod def showFav(cls): for item in fav: print(item) C: class Student: fav=("唱歌","跳舞","绘画") @classmethod def showFav(cls): for item in cls.fav: print(item) D: class Student: fav=("唱歌","跳舞","绘画") @classmethod def showFav(): for item in fav: print(item)
- 接受用户输入,并将其输出为逗号分隔的格式。 item=input(”请输入商品名称:”) sales=input(“请输入商品数量:”) 输出结果需要满足下列要求: 字符串应当在双引号中 数值不能在引号或者其他符号中 每个项目用逗号分隔 请选择正确的3项 A: print(f’”{item}”,{sales}’) B: print(item + ‘,’ + sales) C: print(’”’ + item + ‘”,‘ + sales) D: print(f”{item},{sales}”) E: print(’”%s”, %s’ % (item, sales))
- 将字符串中的数字字符删除后输出。 #include "stdio.h" void delnum(char s[]) { int i,j; for(i=0,j=0;【1】;i++) if(s[i]<'0' 【2】 s[i]>'9') { s[j]=s[i]; j++; } 【3】; } main() { char item[50]; gets(item); 【4】; printf("%s ",item); }
内容
- 0
对于集合S,以下哪些方法是删除元素() A: S.discard(item) B: S.update(item) C: S.pop() D: S.remove(item)
- 1
在Java语言中,下列语句中正确的是()。 A: String temp[] = new String{"j""a""z"}; B: String temp[] = {"j""a""z"}; C: String temp = {"j""a""z"}; D: String temp[] = new String[]{"j","a","z"};
- 2
以下程序的运行结果为()。int mian(){int sum=0,item=0;while(item<5){item++;sum+=item;if(sum==5)break;}printf("%d\n",sum);}
- 3
在 java 语言中, 下列语句中正确的是哪个? ( ) A: String temp[]=new String{"a" "b" "c"}; B: String temp[]={"a" , "b" , "c"}; C: String temp={"a" "b" "c"}; D: String temp[]={"a","b","c"};
- 4
使用SimpleAdapter时要注意用Map<String,Object>item保存列表中每一项显示的title与text。