Connect with us

ACADEMICS

OAU CSC 201 Practice Quiz

Published

on

/60
3 votes, 3.3 avg
573
Created by Oluwaferanmi Akinyele

OAU CSC 201 Practice Quiz

Welcome to the CSC 201 Exam Practice Quiz! All questions are from Sanfoundry.com and have been randomized for each attempt. The quiz will be updated regularly until the exam on Saturday. Use the Full Screen button at the top right for a better experience. Keep practicing, and good luck!

1 / 60

The following is true about python except

2 / 60

Which function is called when the following Python program is executed?

f = foo()
format(f)

 

3 / 60

What will be the output of the following Python expression?

print(4.00/(2.0+2.0))

 

4 / 60

The following python code can work with ____ parameters.

def f(x):
    def f1(*args, **kwargs):
           print("Sanfoundry")
           return x(*args, **kwargs)
    return f1

 

 

5 / 60

Which among the following list of operators has the highest precedence?

 +, -, **, %, /, <<, >>, |

6 / 60

The following is displayed by a print function call. Select all of the function calls that result in this output.

tom
dick
harry

 

7 / 60

What will be the output of the following Python code?

i = 1
while True:
    if i%0O7 == 0:
        break
    print(i)
    i += 1

8 / 60

Which of the following is true for variable names in Python?

9 / 60

Which of the following operators has its associativity from right to left?

10 / 60

What will be the output of the following Python code?

def mk(x):
    def mk1():
        print("Decorated")
        x()
    return mk1
def mk2():
    print("Ordinary")
p = mk(mk2)
p()

11 / 60

What will be the output of the following Python code snippet?

x=3.3456789
'%-6.2f | %05.2f | %+06.1f' %(x, x, x)

 

12 / 60

What will be the output of the following Python code?

'%x %d' %(255, 255)

13 / 60

What will be the value of the following Python expression?

4 + 3 % 5

 

14 / 60

What will be the output of the following Python code?

x = "abcdef"
while i in x:
    print(i, end=" ")

15 / 60

What are the values of the following Python expressions?

 2**(3**2)
 (2**3)**2
 2**3**2

 

16 / 60

What will be the output of the following Python code?

for i in range(int(float('inf'))):
    print (i)

 

17 / 60

Is Python case sensitive when dealing with identifiers?

18 / 60

What will be the output of the following Python code?

['f', 't'][bool('spam')]

a) t
b) f
c) No output
d) Error

19 / 60

Which of the following expressions involves coercion when evaluated in Python?

20 / 60

What is the result of round(0.5) – round(-0.5)?

21 / 60

What will be the output of the following Python program?

  1. def addItem(listParam):
  2.     listParam += [1]
  3. 
    
  4. mylist = [1, 2, 3, 4]
  5. addItem(mylist)
  6. print(len(mylist))

22 / 60

What will be the output of the following Python statement?

  1. >>>"a"+bc

 

23 / 60

Any odd number on being AND-ed with ________ always gives 1. Hint: Any even number on being AND-ed with this value always gives 0.
a) 10
b) 2
c) 1
d) 0

24 / 60

Select all options that print.

hello-how-are-you

 

25 / 60

What will be the output of the following Python code?

s='{0}, {1}, and {2}'
s.format('hello', 'good', 'morning')

 

26 / 60

The output of the two codes shown below is the same.

i. '{0:.2f}'.format(1/3.0)
ii. '%.2f'%(1/3.0)

27 / 60

What will be the output of the following Python code?

>>>print (r"\nhello")

28 / 60

Which of the following is the truncation division operator?

29 / 60

What will be the output of the following Python code snippet?

for i in [1, 2, 3, 4][::-1]:
    print(i, end=' ')

a) 4 3 2 1
b) error
c) 1 2 3 4
d) none of the mentioned

30 / 60

What will be the output of the following Python expression if x=56.236?

print("%.2f"%x)

31 / 60

What is the value of the following expression?

2+4.00, 2**4.0

 

32 / 60

What will be the output of the following Python code?

'{a}{b}{a}'.format(a='hello', b='world')

33 / 60

All keywords in Python are in _________

34 / 60

What is the maximum possible length of an identifier in Python?

35 / 60

What does pip stand for python?

36 / 60

What will be the output of the following Python code snippet if x=1?

x<<2

 

37 / 60

What will be the output of the following Python code?

x = 'abcd'
for i in range(len(x)):
    print(i)

 

38 / 60

What will be the output of the following Python code?

 D=dict(p='san', q='foundry')
'{p}{q}'.format(**D)

 

39 / 60

What will be the value of the following Python expression?

4 + 3 % 5

 

40 / 60

Which of the following cannot be a variable?

41 / 60

Operating Systems includes the following except

42 / 60

What will be the output of the following Python code?

i = 2
while True:
    if i%3 == 0:
        break
    print(i)
    i += 2

43 / 60

What is the output of this expression, 3*1**3?

44 / 60

What will be the output of the following Python code if a=10 and b =20?

a=10
b=20
a=a^b
b=a^b
a=a^b
print(a,b)

45 / 60

What will be the output of the following Python code snippet?

X=”san-foundry”
print(“%56s”,X)

46 / 60

A computer software comprises of ___________ software & ___________ software

47 / 60

Which is the correct operator for power(xy)?

48 / 60

In the following Python code, which function is the decorator?

def mk(x):
    def mk1():
        print("Decorated")
        x()
    return mk1
def mk2():
    print("Ordinary")
p = mk(mk2)
p()

49 / 60

What will be the output of the python code shown below for various styles of format specifiers?

x=1234
res='integers:...%d...%-6d...%06d' %(x, x, x)
res

50 / 60

Which of the following is an invalid statement?

51 / 60

What will be the output of the following Python expression?

round(4.576)

 

52 / 60

Which one of these is floor division?

53 / 60

The expression shown below results in an error.

print("-%5d0",989)

a) True
b) False

54 / 60

Python was created in what year

55 / 60

The one’s complement of 110010101 is:

56 / 60

A ________ is a sequence of instructions telling the computer what to do.

57 / 60

What will be the output of the following Python expression if x=15 and y=12?

x & y

 

58 / 60

What will be the output of the following Python function?

len(["hello",2, 4, 6])

a) Error
b) 6
c) 4
d) 3

59 / 60

Which among the following list of operators has the highest precedence?

“` +, -, **, %, /, <<, >>, |“`

60 / 60

What will be the output of the following Python code?

i = 1
while True:
    if i%3 == 0:
        break
    print(i)
 
    i + = 1

 

Your score is

The average score is 22%

0%


Discover more from 9jabaz

Subscribe to get the latest posts sent to your email.

Advertisement
Comments
Scroll Up

Discover more from 9jabaz

Subscribe now to keep reading and get access to the full archive.

Continue reading

..

9jabaz.