Search Header Logo

Fundamentals of Python Programming

Authored by Dr. Nakrani

Other

University

Used 2+ times

Fundamentals of Python Programming
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct file extension for Python files?

.java

.cpp

.txt

.py

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

1variable

variable-name

variable@name

variable1

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What keyword is used to define a function in Python?

def

method

procedure

function

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you insert comments in Python code?

Use '//' for single-line comments and '/* */' for multi-line comments.

Use '#' for single-line comments and triple quotes for multi-line comments.

Use '@' for comments and '"""' for multi-line comments.

Use '!' for comments and '[]' for multi-line comments.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

1

0

3

9

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

List

String

Integer

User-defined class

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the 'self' parameter in class methods?

The 'self' parameter is used to create new classes.

The 'self' parameter is a keyword for static methods.

The 'self' parameter is used to refer to the instance of the class in class methods.

The 'self' parameter is used to define class variables.

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?