Python-test

Python-test

Professional Development

9 Qs

quiz-placeholder

Similar activities

M0-Command Line Basics Quiz

M0-Command Line Basics Quiz

Professional Development

9 Qs

Kpop Kuis

Kpop Kuis

Professional Development

10 Qs

CSS flexbox quiz

CSS flexbox quiz

Professional Development

10 Qs

SEO

SEO

Professional Development

10 Qs

#Sg_Spaic Last season Quiz (ML and Python)

#Sg_Spaic Last season Quiz (ML and Python)

KG - Professional Development

10 Qs

Django Basic

Django Basic

Professional Development

10 Qs

Python Practice 2

Python Practice 2

Professional Development

11 Qs

Tipus de fitxers

Tipus de fitxers

Professional Development

13 Qs

Python-test

Python-test

Assessment

Quiz

Other

Professional Development

Hard

Created by

KALIDINDI THARUN

Used 1+ times

FREE Resource

9 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code snippet?

x = 5

y = 2

print(x ** y)

10
7
3
25

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the len() function do in Python?

It converts all elements in a list to uppercase.
It sorts the elements in a list in descending order.
It calculates the sum of all elements in a list.
It returns the number of items in a container.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements is true about Python?

Python is primarily used for front-end development
Python is an interpreted, high-level, general-purpose programming language known for its simplicity and readability.
Python is a compiled programming language
Python does not support object-oriented programming

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code snippet?

my_list = [1, 2, 3, 4, 5]

print(my_list[1:3])

[2, 4]
[1, 3]
[2, 3]
[3, 5]

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct way to open a file in Python for writing?

open('file.txt', 'w')
open('file.txt', 'x')
open('file.txt', 'a')
open('file.txt', 'r')

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

variable_name
variable$
1variable
1variable

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the strip() method do in Python?

Converts a string to uppercase
Removes leading and trailing characters from a string
Reverses the order of characters in a string
Adds characters to a string

8.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code snippet?

my_dict = {'a': 1, 'b': 2, 'c': 3}

print(my_dict.get('d', 4))

5
4
6
3

9.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is used to define a function in Python?

define keyword
function keyword
def keyword
create keyword