Exploring Python Fundamentals

Exploring Python Fundamentals

University

42 Qs

quiz-placeholder

Similar activities

Operators in Python

Operators in Python

University

43 Qs

Exception Handling

Exception Handling

University

39 Qs

10th Grade 10  - IT Programming - 2nd Cycle Exam

10th Grade 10 - IT Programming - 2nd Cycle Exam

10th Grade - University

40 Qs

Python Quiz BF-7

Python Quiz BF-7

University

43 Qs

Quiz on Programming Basics

Quiz on Programming Basics

3rd Grade - University

43 Qs

CIA VIVA- Practical & Theory

CIA VIVA- Practical & Theory

University

40 Qs

Semester Final 2025

Semester Final 2025

10th Grade - University

40 Qs

standard input output

standard input output

University

41 Qs

Exploring Python Fundamentals

Exploring Python Fundamentals

Assessment

Quiz

Computers

University

Medium

Created by

Mr. Gogoi

Used 2+ times

FREE Resource

42 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What are the basic data types in Python?

float, number, string, object

int, float, str, bool, list, tuple, set, dict

integer, decimal, text, map

char, byte, string, array

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

How do you create a list in Python?

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

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

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).

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the purpose of an if statement in Python?

To execute code conditionally based on a boolean expression.

To repeat code multiple times.

To create a loop for iteration.

To define a function in Python.

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Explain the use of for loops in Python.

For loops in Python are primarily used for error handling.

For loops can only iterate over numbers in Python.

For loops in Python are used to define functions.

For loops in Python allow iteration over sequences and execute a block of code for each item.

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is a function in Python and how is it defined?

A function in Python is defined using the 'func' keyword.

A function in Python is defined using the 'def' keyword, followed by the function name and parentheses.

A function in Python is defined by writing the function name followed by a colon.

Functions in Python are created with the 'create' keyword.

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

How can you import a module in Python?

You can import a module by copying its code directly into your script.

Use the 'require' statement to load the module.

Modules can only be imported from the current directory.

Use the 'import' statement followed by the module name.

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the purpose of the open() function in file handling?

To open a file and return a file object for file handling operations.

To create a new file without opening it.

To delete a file from the system.

To read the contents of a file into memory.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?