Search Header Logo

Python Basics Quiz

Authored by sai pavan

Computers

12th Grade

Used 1+ times

Python Basics Quiz
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

What is the syntax to create an empty list in Python?

()

empty()

{}

[]

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Write a MySQL query to select all columns from a table named 'users'.

SELECT * FROM users;

SELECT * FROM data;

SELECT * FROM customers;

SELECT * FROM info;

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What data type is used to store a single character in Python?

bool

str

float

int

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you declare a variable in Python?

variable = value

variable_name = value

declare variable_name

value = variable_name

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of a 'for' loop in Python?

To create a new variable

To define a function

To perform mathematical calculations

To iterate over a sequence and execute a block of code for each item

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the '==' operator used for in Python?

It is used for defining functions

It is used for looping

It is used for addition

It is used for comparison.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you write an 'if' statement in Python?

if (condition) {

if condition:

if (condition) then:

if (condition) == True:

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?