Search Header Logo

Python Basics: Variables and Loops Quiz

Authored by Z Begum

Computers

8th Grade

Used 4+ times

Python Basics: Variables and Loops Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct way to declare a variable called `age` with the value 13 in Python?

int age = 13

age = 13

age : int = 13

declare age = 13

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the data type of the value `"Hello"` in Python?

int

float

str

bool

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which operator is used to add two numbers in Python?

+

&

%

$

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code? ```python print(3 + 4) ```

34

7

3+4

Error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a correct way to concatenate two strings `first` and `last` in Python?

first + last

first . last

first, last

first * last

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code? ```python print("Good" + " " + "Morning") ```

GoodMorning

Good Morning

Good+Morning

Good Morning (with two spaces)

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid Python data type?

integer

number

str

decimal

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?