Search Header Logo

Python编程基础测试-5级

Authored by 小星 翟

Computers

7th Grade

Used 4+ times

Python编程基础测试-5级
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

43 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

以下代码的输出结果是?() nums=list(range(100,201)) print(nums[::10])

[100,110,120,130,140,150,160,170,180,190,200]

[100,101,102,103,104,105,106,107,108,109,200]

[100,111,122,133,144,155,166,177,188,199]

[199,188,177,166,155,144,133,122,111,100]

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

以下代码的输出结果是?() def count_odd_numbers(n): return len([num for num in range(n) if num % 2 != 0]) print(count_odd_numbers(20))

5

8

10

15

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

以下代码的输出结果是?() for i in range(5): print(''*(5-i)+'*'*(2*i+1))

错误,代码无法运行

打印出一个梯形状的星星

打印出一个倒立的三角形

打印出一个正立的三角形

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

运行以下代码的结果是?() nums=range(1,11) sliced_nums=nums[2:8] result=sum(sliced_nums)*3 print(result)

90

99

81

72

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

集合a={1,2,3,4,5,6},b={1,3,5,7,9},则a&b的结果是?()

{1,3,5}

{2,4,6}

{1,2,3,4,5,6,1,3,5,7,9}

[1,3,5]

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

下列程序的运行结果?() a={6,5,4,3,2,1} a.remove(1) print(a)

{6,5,4,3,2}

{1,2,3,4,5}

{1,2,3,4,5}

[2,3,4,5,6]

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

智慧种植社团想要确定农植园西红柿元组的最大值,可以使用下列方法?()

list()

max()

min()

sum()

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?