Search Header Logo

AWS Python Booster Day 3

Authored by CloudThat Technologies

Professional Development

Professional Development

Used 4+ times

AWS Python Booster Day 3
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The first character in a string is at index 1.

True

False

May be

None of the above

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which print output is the result of the following code?

word = "windows"

print(word[-1])

"w"

"s"

"i"

" " (empty string)

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which choice will print the word "tac", given the following variable declaration?

word = "cat"

print(word[::-1])

print(word[::1])

print(word[0:1:2])

print(word[2:1:0])

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The .count() string method returns the number of times a for/in loop iterates.

True

False

May be

None of the above

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which string method returns an index of first character or substring matches?

.find()

.count()

.isalpha()

while

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which choice is a valid Python code to store the length of the given string variable 'word' in 'x'?

word = "Python"

x = len(word)

x = word.len()

x.length(word)

for x in length of word

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which is a valid way to initialize a Python list?

scores = [11, 8, 0, 24, 31, 12, 19]

listdef scores(11, 8, 0, 24, 31, 12, 19)

scores.list(11, 8, 0, 24, 31, 12, 19)

scores = {11:8:0:24:31:12:19}

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?

Discover more resources for Professional Development