Search Header Logo

Python data types

Authored by Sherif Abdelhamid

Others

University

Used 10+ times

Python data types
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Assume the variable x has been initialized to an integer value (e.g., x = 3). What does the following statement do?

x = x + 2

This would fail as it is a syntax error

Produce the value "false" because "x" can never equal "x+2"

Retrieve the current value for x, add two to it and put the sum back into x

Create a function called "x" and put the value 2 in the function

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the value of x after the following statement executes:

x = 1 + 2 * 3 - 8 / 4

5.0

4

15

3.0

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following elements of a mathematical expression in Python is evaluated first?

*

/

()

+

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not a Python reserved word?

iterate

continue

break

else

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a bad Python variable name?

Spam

_spam

23spam

SPAM23

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which character represents a comment in Python code?

*

#

&

$

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the Python code needed to ask a user for input?

input("what is your name?")

input="what is your name?"

(input)=what is your name?

input=what is your name?

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?