Search Header Logo

Python and SQL Quiz

Authored by Shubham Mishra

Computers

University

Used 8+ times

Python and SQL Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

18 questions

Show all answers

1.

FILL IN THE BLANK QUESTION

1 min • 1 pt

State True or False: The Python interpreter handles logical errors during code execution.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Identify the output of the following code snippet: text = "PYTHONPROGRAM" text=text.replace('PY','#') print(text)

#THONPROGRAM

##THON#ROGRAM

#THON#ROGRAM

#YTHON#ROGRAM

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following expressions evaluates to False?

not(True) and False

True or False

not(False and True)

True and not(False)

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the expression? str='International' print(str.split("n"))

('I', 'ter', 'atio', 'al')

['I', 'ter', 'atio', 'al']

['I', 'n', 'ter', 'n', 'atio', 'n', 'al']

Error

5.

FILL IN THE BLANK QUESTION

1 min • 1 pt

What will be the output of the following code snippet? str= "World Peace" print(str[-2::-2])

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code? tuple1 = (1, 2, 3) tuple2 = tuple1 tuple1 += (4,) print(tuple1 == tuple2)

True

False

tuple1

Error

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If my_dict is a dictionary as defined below, then which of the following statements will raise an exception? my_dict = {'apple': 10, 'banana': 20, 'orange': 30}

my_dict.get('orange')

print(my_dict['apple', 'banana'])

my_dict['apple']=20

print(str(my_dict))

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