Search Header Logo

Mastering Python Fundamentals

Authored by Phani Kishore

Computers

Professional Development

Used 1+ times

Mastering Python Fundamentals
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 correct file extension for Python files?

.txt

.cpp

.py

.java

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid variable name in Python?

variable1

1variable

variable name

variable-name

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the expression 3 * 1 ** 3?

1

9

0

3

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you create a list in Python?

You create a list in Python using square brackets, e.g., my_list = [1, 2, 3].

You create a list in Python using parentheses, e.g., my_list = (1, 2, 3).

You create a list in Python by using the list() function without any arguments.

You create a list in Python using curly braces, e.g., my_list = {1, 2, 3}.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What keyword is used to define a function in Python?

method

def

define

function

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not a built-in data type in Python?

tuple

list

array

dictionary

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the 'if' statement in Python?

To import modules in Python.

To execute code conditionally based on a boolean expression.

To define a function in Python.

To create a loop in Python.

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?