Search Header Logo

python basic 1

Authored by Vengadapathiraj M

Computers

University

Used 4+ times

python basic 1
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the proper syntax to check if a particular element is present in a list?

if ele in list

if not ele not in list

Both A & B

None of the above

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will be the output of the following code snippet?

Five neither thrive three

Five neither three thrive

three three three three

Five neither Five neither

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code snippet?

def check(a):

print("Even" if a % 2 == 0 else "Odd")

check(12)

Even

Odd

Error

None

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code snippet?

example = ["Sunday", "Monday", "Tuesday", "Wednesday"];

print(example[-3:-1])

['Sunday', 'Monday']

['Sunday', 'Tuesday']

['Monday', 'Tuesday']

['Wednesday', 'Monday']

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code snippet?

a = [1, 2]

print(a * 3)

Error

[1, 2]

[1, 2, 1, 2]

[1, 2, 1, 2, 1, 2]

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code snippet?

example = ["Sunday", "Monday", "Tuesday", "Wednesday"];

del example[2]

print(example)

['Sunday', 'Monday', 'Wednesday']

['Monday', 'Tuesday', 'Wednesday']

['Sunday', 'Monday', 'Tuesday', 'Wednesday']

['Sunday', 'Monday', 'Tuesday']

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the type of the variable sorted_numbers in the below code snippet?

numbers = (4, 7, 19, 2, 89, 45, 72, 22)

sorted_numbers = sorted(numbers)

print(sorted_numbers)

List

Tuple

String

Int

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?

Discover more resources for Computers