Python: Strings

Python: Strings

University

9 Qs

quiz-placeholder

Similar activities

coding

coding

7th Grade - University

14 Qs

PYTHON_CHAPTER 2

PYTHON_CHAPTER 2

University

10 Qs

Building Powerful Web Applications with Laravel 11

Building Powerful Web Applications with Laravel 11

University

10 Qs

ทำความรู้จักกับภาษาไพทอน

ทำความรู้จักกับภาษาไพทอน

University

10 Qs

Quiz 1 - Intro to C#

Quiz 1 - Intro to C#

University

10 Qs

Java Displaying Data & Data Types

Java Displaying Data & Data Types

University - Professional Development

12 Qs

Web-II-Loop and Function

Web-II-Loop and Function

University

10 Qs

Algo 1

Algo 1

University

10 Qs

Python: Strings

Python: Strings

Assessment

Quiz

Computers

University

Practice Problem

Medium

Created by

Dr.SL Rao

Used 8+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

9 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the following Python Program print out?

str1 = "Hello"

str2 = 'there'

s = str1 + str2

print(s)

Hello

there

Hellothere

Hello there

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the following Python Program print out?

x = '40'

y = int(x) + 2

print(y)

42

402

int402

x2

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How would you use the index operator [] to print out the letter h from the following string

x = 'Python Programming Strings'

print(x[4])

print(x[h])

print(x[3])

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How would you use the slicing [:] to print out the letter 'gram' from the following string

x = 'Python Programming Strings'

print(x[10:13])

print(x[10:14])

print(x[9:12])

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the iteration variable in the following Python code?

for letter in 'banana' :

print(letter)

in

letter

for

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How would you print out the following variable in all upper case in Python?

greet = 'Hello Everyone'

print(greet.ucase())

print(greet.touppercase())

print(greet.upper())

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following string methods removes whitespace from both the beginning and end of a string?

strip()

rstrip()

strtrunc()

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 Computers