Python Programming Prowess

Python Programming Prowess

12th Grade

10 Qs

quiz-placeholder

Similar activities

Python2 M1

Python2 M1

5th - 12th Grade

11 Qs

Introduction to Python

Introduction to Python

University

15 Qs

Python - 3.4.13 - Lists Quiz

Python - 3.4.13 - Lists Quiz

12th Grade

8 Qs

codestorm

codestorm

University

10 Qs

Python 101

Python 101

University

15 Qs

Python Class XII

Python Class XII

12th Grade

15 Qs

Mini Quiz IF2112

Mini Quiz IF2112

University

15 Qs

Python - from 0 to HERO

Python - from 0 to HERO

University

15 Qs

Python Programming Prowess

Python Programming Prowess

Assessment

Quiz

Computers

12th Grade

Hard

Created by

Brian Akwirry

Used 2+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to check if the user input is a number in Python?

`if input.isdigit():`

`if input().isnumeric():`

`if input.isnumeric():`

`if isinstance(input, int):`

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you convert the string `"123"` to an integer in Python?

`int("123")`

`str(123)`

`"123".to_i()`

`integer("123")`

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following function definitions is correct in Python?

`def my_function:`

`function my_function():`

`def my_function():`

`define my_function():`

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you add a key-value pair to a dictionary in Python?

`my_dict.add('key', 'value')`

`my_dict['key'] = 'value'`

`my_dict.append({'key': 'value'})`

`my_dict.insert('key', 'value')`

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code snippet? ```python my_list = [1, 2, 3] my_list.append(4) print(my_list) ```

`[1, 2, 3, 4]`

`[4, 1, 2, 3]`

`[1, 2, 3]`

`SyntaxError`

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you remove the last item from a list in Python?

`my_list.remove(-1)`

`my_list.delete(last)`

`my_list.pop()`

`del my_list[-1]`

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to concatenate two strings, `a` and `b`, in Python?

`a + b`

`a.concat(b)`

`a.append(b)`

`concat(a, b)`

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?