Mastering Python Strings (12A-B IT ESSENTIALS)

Mastering Python Strings (12A-B IT ESSENTIALS)

12th Grade

15 Qs

quiz-placeholder

Similar activities

LETS PLAY QUIZ - PYTHON CBSE CLASS XII

LETS PLAY QUIZ - PYTHON CBSE CLASS XII

11th - 12th Grade

20 Qs

ASK T2 - Kod Arahan (Python)

ASK T2 - Kod Arahan (Python)

7th Grade - University

20 Qs

Exploring Python: Input and Output Essentials

Exploring Python: Input and Output Essentials

9th Grade - University

10 Qs

python quiz

python quiz

6th Grade - Professional Development

10 Qs

String Data Type(Python)

String Data Type(Python)

12th Grade

20 Qs

Project-Stem Unit 1 python coding

Project-Stem Unit 1 python coding

9th - 12th Grade

12 Qs

PYTHON PROGRAMMING

PYTHON PROGRAMMING

11th - 12th Grade

15 Qs

Python Quiz

Python Quiz

12th Grade

11 Qs

Mastering Python Strings (12A-B IT ESSENTIALS)

Mastering Python Strings (12A-B IT ESSENTIALS)

Assessment

Quiz

Computers

12th Grade

Medium

Created by

Imhotep Brooks

Used 12+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Python code?

lst = [3, 6, 9, 12]

lst.append(lst[2] * 2)

print(lst)

[3, 6, 9, 12, 12]

[3, 6, 9, 12, 18]

[3, 6, 9, 12, 6]

[3, 6, 9, 12, 24]

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you format a string using f-strings in Python?

Use f'string {variable}' to format a string with variables.

Use 'string {variable}' without f prefix.

Format strings with 'format()' method instead.

Concatenate variables using '+' operator.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Python code?

list1 = [1, 2, 3]

list2 = list1

list2.append(4)

print(list1)

[1, 2, 3]

[1, 2, 3, 4]

TypeError

[4, 1, 2, 3]

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method would you use to convert a string to Uppercase?

.lowercase()

.convertToLower()

.upper()

.toLowerCase()

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code?

x = "7.5"

y = int(float(x))

print(y, type(y))

7.5 <class 'int'>

7 <class 'int'>

7.5 <class 'float'>

TypeError

6.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

How can you slice the string 'Programming' to get 'program'?

print(x[2:7])

print(x[0:7])

print(x[3:8])

print(x[-4:])

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Python code?

x = 10 % 5

y = 10 // 3

z = x + y * 2

print(z)

9

8

6

5

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?