Tutorat_8

Tutorat_8

University

8 Qs

quiz-placeholder

Similar activities

T02: Python - The Basics

T02: Python - The Basics

University

10 Qs

Python Chapter

Python Chapter

8th Grade - University

12 Qs

GDSC Python Bootcamp

GDSC Python Bootcamp

University

8 Qs

Splitting, Concatenating, and Joining Strings in Python

Splitting, Concatenating, and Joining Strings in Python

University

6 Qs

Q2 - Python

Q2 - Python

University

10 Qs

03 - Python - Basics

03 - Python - Basics

University - Professional Development

10 Qs

Conditionals

Conditionals

University

11 Qs

The OOP Quiz

The OOP Quiz

University

10 Qs

Tutorat_8

Tutorat_8

Assessment

Quiz

Computers

University

Easy

Created by

Maritina Panagiotopoulou

Used 1+ times

FREE Resource

8 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In Python, what is the primary purpose of a class?

To define the data type of a variable

To create instances of objects with specific attributes and methods

To provide a way to format strings

To define the encoding of Unicode characters

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements about F-strings in Python is correct?

F-strings are used for defining classes

F-strings are a way to format strings with variable values

F-strings are used for defining Unicode characters

F-strings are not supported in Python

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is true about methods in programming classes?

Methods are standalone functions not associated with any class

Methods define the behavior of objects in a class and are common to all objects of that class

Methods are unique for each object and cannot be shared between objects

Methods in a class are only for displaying object properties

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

How is a function defined in Python?

By using the function keyword

With the def keyword followed by the function's name and parameters

Functions in Python do not need to be defined

Using the return statement before writing the function body

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the findall() method return in Python?

A single match of the pattern

A dictionary containing all matches

The first group of matches in the pattern

A list of the entire matches of the pattern

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the outcome when using (?:...) in a regex pattern with findall()?

It captures the group and returns it as part of the result

The part of the pattern inside (?:...) is not captured but affects the matches

It causes an error in the findall() method

findall() ignores the entire regex pattern

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do functions affect the control flow in a Python program?

The control flow jumps to the function's code when called and returns after execution.

Functions prevent the program from executing any code.

Functions do not affect control flow in Python.

Control flow is interrupted permanently once a function is called.

8.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does type(2 == 1 + 1) return?

True

bool