Search Header Logo

Mid Term Practice AX

Authored by Mandeep Singh

Computers

University

Used 4+ times

Mid Term Practice AX
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

95 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What will be the value of the following Python expression?>>> 4 + 3 % 5

7
2
4
1

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What will be the output of the following Python function? >>> min(max(0,-3,-4), 2, 7, False)

0
-3
2

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which are the wrong statements?

s = "hello", [0] s[-1][0] = 'p'
s="hello" S = 'self'[0] + 'hello' + s
ls = [] out = ls if ls.pop() else 10 print(out)
l=[1,3,4] l.pop(2)

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What will be the output of the below Python code? tupl=("annie","hena","sid") print(tupl[-3:0])

("annie")
()
None
Error as slicing is not possible in tuple

5.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What will be the output of the below Python code? tupl=() tupl1=tupl*2 print(len(tupl1))

0
2
1
Error as tuple object has no attribute to len

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Output after execution of these lines? >>> x = 3 >>> sum(x ** 3 for x in range(1) for x in range(1) if x % 3 == 1)

Error
27
54

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Output of the following code? a = True b = False c = True if not a or b: print ("a") elif not a or not b and c: print ("b") elif not a or b or not b and a: print ("c") else: print ("d")

a
b
c
d

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?