在列表:c=["black","red","green","ye

题目

在列表:c=["black","red","green","yellow","orange","blue"]中,设定变量j=3,那么运行代码turtle.pencolor(c[j])后,画笔的颜色将变成黄色。

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

已知枚举类型声明语句为: enumCOLOR{WHITE,YELLOW,GREEN=5,RED,BLACK=10}; 则下列说法中错误的是

A.枚举常量YELLOW的值为1

B.枚举常量RED的值为6

C.枚举常量BLACK的值为10

D.枚举常量WHITE的值为1


正确答案:D
解析:枚举变量中的枚举元素系统是按照常量来处理的。如果没有进行元素赋值操作,那么元素将会被系统从0开始自动递增地进行赋值操作,但是,如果一旦定义了某一个元素的值,那么系统将对下一个元素进行按前一个元素的值加1操作,故wHITE=1,YELLOW=2,GREEN=5,RED=6,BLACK=10。

第2题:

以下选项中不能正确把c1定义成结构体变量的是

A.typedef struct {int red: int green: int blue; } COLOR; COLOR c1;

B.struct color c1 {int red int green: int blue; };

C.struct color {int red , int green : int blue : )cl;

D.struct {int red; int green; int blue } c1 ;


正确答案:B
解析:本题考核的知识点是结构体类型定义。结构体类型的定义格式为:strcut结构体名{成虽说明列表};结构体变量的定义有3种形式:第一种,定义结构体型的同时定义结构体变量,如:strcut结构体名{成员说明列表}变量;选项C属于这种情况,故选项C正确:第二种,先定义一个结构体类型,然后使用该类型来定义结构体变量,如:strcutstudent{成员说明列表}:student变量;选项A属于这种情况,故选项A正确;第三种,定义一个无名称的结构体类型的同时定义结构体变量,如:strcutstudent{成员说明列表}变量;选项D属于这种情况,故选项D正确.所以,4个选项中选项B符合题意。

第3题:

设有说明var color:(red,green,yellow,blue);a:boolean;下面语句正确的是( )。

Aolor:=‘green‘;

Bwriteln(green);

Cwriteln(color);

Da:=color=red;


正确答案:D

第4题:

WhichofthefollowingisthecorrectwiringorderforanRJ-11twolinejack?()

A.Black,Green,Red,Yellow

B.Black,Red,Green,Yellow

C.Red,Black,Green,Yellow

D.Yellow,Red,Green,Black


参考答案:B

第5题:

下列枚举类型的定义中,包含枚举值3的是

A.enum test{RED,YELLOW,BLUE,BLACK};

B.enum test{RED,YELLOW=4,BLUE,BLACK};

C.enum test{RED=-1,YELLOW,BLUE,BLACK};

D.erium test{RED,YELLOW=6,BLUE,BLACK};


正确答案:A
解析:在枚举类型定义中,如果没有进行显式设置,则隐式设置整数值。将枚举声明中的第一个枚举值设置为O。后续所有成员的值如果没有进行显式设置,便确定为前一个成员的值加1。所以只能选择答案A)。选项B)中对应的枚举值是0,4,5,6;选项c)中对应的枚举值是-1,0,1,2;选项D)中对应的枚举值是0,6,7,8。

第6题:

As a man with plenty of guts, he is the person who is expected to bring success to this company which is on the verge of bankruptcy.

A、the great white hope

B、the great red hope

C、the great green hope

D、the great black hope


参考答案:A

第7题:

以下选项中不能正确把cl定义成结构体变量的是

A.typedef struct { int red; int green; int blue; } COLOR; COLOR cl;

B.struct color cl { int red; int green; int blue; }

C.struct color { int red; int green; int blue; } cl;

D.struct { int red; int green; int blue; } cl;


正确答案:B
解析:选项A)是把结构体类型改名后定义为变量cl。选项C),D)则是在定义结构体类型时定义变量,而选项B)不符合结构体类型定义的语法规则。

第8题:

( 18 )下列枚举类型的定义中,包含枚举值 3 的是

A ) enum test {RED, YELLOW, BLUE, BLACK};

B ) enum test {RED, YELLOW=4, BLUE, BLACK};

C ) enum test {RED=-1, YELLOW,BLUE, BLACK};

D ) enum test {RED, YELLOW=6, BLUE, BLACK};


正确答案:A

第9题:

以下选项中不能正确把c1定义成结构体变量的是

A.typedef struct { int red; int green;; int blue; }COLOR; COLOR cl;

B.struct color cl { int red; int green; int blue; };

C.struet color { int red; int green; int blue; }c1;

D.struct { int red; int green; int blue; }cl;


正确答案:B
解析:结构体类型的定义格式为:
  stract结构体名
  成员说明列表};
  结构体变量的定义有3种形式:第一种,定义结构体类型的同时定义结构体变量,如: street结构体名{成员说明列表}变量;第二种,先定义一个结构体类型,然后使用该类型来定义结构体变量,如:strect student{成员说明列表};student变量;第三种,定义一个无名称的结构体类型的同时定义结构体变量,如:strect student{成员说明列表}变量;。

第10题:

下列选项中不能正确定义结构体的是_______。

A.typedef struct

B.struct color cl {int red; {int red; int green; int green; int blue; int blue; }COLOR; }; COLOR cl;

C.struct color

D.struct {int red; {int red; int green; int green; int blue; int blue; }cl; }cl;


正确答案:B
解析:将一个变量定义为标准类型与定义为结构体类型不同之处在于:后者不仅要求指定变量为结构体类型,而且要求指定为某一特定的结构体类型(例如,struct color),不能只指定结构体名。其中可以不出现结构体名,答案D就是缺省结构体名的隋况。而变量名歹婊必须放在成员列表后面,所以B答案不能正确将cl定义为结构件变量。

更多相关问题