Python_Ch7_User inputs and testing your code

Python_Ch7_User inputs and testing your code

Professional Development

16 Qs

quiz-placeholder

Similar activities

Introduction to Machine Learning

Introduction to Machine Learning

University - Professional Development

20 Qs

Pioneer Coding - Mid Year Quiz (Python and Pokemon)

Pioneer Coding - Mid Year Quiz (Python and Pokemon)

Professional Development

15 Qs

FORMATIVE ASSESSMENT 2 OOPS

FORMATIVE ASSESSMENT 2 OOPS

Professional Development

15 Qs

ANOVISION ROUND 2

ANOVISION ROUND 2

Professional Development

20 Qs

Python - CDT

Python - CDT

Professional Development

20 Qs

CodeHS - Intro to Python - Basics and Console Interaction

CodeHS - Intro to Python - Basics and Console Interaction

9th Grade - Professional Development

20 Qs

Datatypes and Flowcontrol

Datatypes and Flowcontrol

Professional Development

15 Qs

SEC+ Ch.7 Review Test

SEC+ Ch.7 Review Test

Professional Development

15 Qs

Python_Ch7_User inputs and testing your code

Python_Ch7_User inputs and testing your code

Assessment

Quiz

Computers

Professional Development

Medium

Used 2+ times

FREE Resource

16 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the default return type of input()?

Integer

String

Float

List

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which function is used to take user input in Python?

get()

input()

scan()

read()

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you convert the result of input() to an integer in Python?

int(input())

str(input())

float(input())

bool(input())

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does assert do in a test case?

Prints a message

Stores a variable

Defines a loop

Raises an error if a condition is false

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. What is a test case in unittest?

  1. A method that tests a specific functionality

  1. A class attribute

  1. A loop over data

  1. A function that processes input

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you validate that input is not empty?

if input == 0

if input.isalpha()

if input.isdigit()

if input == ""

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a unit test?

A test of user input

A test of the entire program

A test of a specific function or method

A test of a loop

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?