Python-test

Python-test

Professional Development

9 Qs

quiz-placeholder

Similar activities

Guess the K-pop Group/Artist

Guess the K-pop Group/Artist

KG - Professional Development

11 Qs

Python Basics

Python Basics

Professional Development

10 Qs

IT files types for gender neutral Apache helicopters

IT files types for gender neutral Apache helicopters

KG - Professional Development

13 Qs

HTML

HTML

KG - Professional Development

8 Qs

Python Loop Statements

Python Loop Statements

Professional Development

10 Qs

FinTech 02-3 Python

FinTech 02-3 Python

Professional Development

10 Qs

Semana 4 con Python

Semana 4 con Python

Professional Development

10 Qs

DevOps-1 [Git, CICD and Configuration Management]

DevOps-1 [Git, CICD and Configuration Management]

Professional Development

10 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