Python Input Basics Quiz

Python Input Basics Quiz

8th Grade

15 Qs

quiz-placeholder

Similar activities

2 Python Variables

2 Python Variables

7th - 9th Grade

10 Qs

Python пр.работа №1

Python пр.работа №1

7th - 8th Grade

10 Qs

Python Quiz

Python Quiz

3rd Grade - Professional Development

11 Qs

PowerPoint Slide Basics

PowerPoint Slide Basics

KG - Professional Development

10 Qs

Вопросы по циклам в Python

Вопросы по циклам в Python

8th - 11th Grade

16 Qs

TEST

TEST

KG - Professional Development

17 Qs

Python Input Basics Quiz

Python Input Basics Quiz

Assessment

Quiz

Fun

8th Grade

Hard

Created by

Ben Saddington

Used 2+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What function is used in Python to take input from the user?

`print()`

`input()`

`read()`

`scan()`

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a correct way to prompt the user for their name in Python?

`name = input("Enter your name: ")`

`name = input("Enter your name")`

`name = input()`

`name = input("Enter your name: ", "Name")`

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What data type does the `input()` function return by default?

Integer

Float

String

Boolean

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you convert a user input to an integer in Python?

`int(input())`

`str(input())`

`float(input())`

`bool(input())`

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will happen if you try to convert a non-numeric input to an integer using `int(input())`?

It will return 0

It will return an empty string

It will raise a `ValueError`

It will return `None`

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a method to handle errors in Python?

`try-except`

`if-else`

`for-while`

`switch-case`

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the `except` block in Python?

To execute code when no errors occur

To execute code when an error occurs

To define a function

To import a module

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?