Connect with us

ACADEMICS

OAU CSC 201 Practice Quiz

Published

on

/60
3 votes, 3.3 avg
569
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 python program can work with ____ parameters.

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

 

2 / 60

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

3 / 60

What is the type of inf?

4 / 60

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

x & y

 

5 / 60

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

for i in 'abcd'[::-1]:
    print (i)

6 / 60

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

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

7 / 60

Which of the following Python statements will result in the output: 6?

A = [[1, 2, 3],
     [4, 5, 6],
     [7, 8, 9]]

 

8 / 60

Which of the following is an invalid statement?

9 / 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)

10 / 60

What will be the output of the following Python expression?

bin(29)

 

11 / 60

What will be the output of the following Python code?

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

12 / 60

In flow charts, a terminal is represented with what shape

13 / 60

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

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

14 / 60

What will be the output of the following Python code?

'{a}, {0}, {abc}'.format(10, a=2.5, abc=[1, 2])

15 / 60

Is Python code compiled or interpreted?

16 / 60

What will be the output of the following Python code?

True = False
while True:
    print(True)
    break

17 / 60

What will be the output of the following Python code?

def d(f):
    def n(*args):
        return '$' + str(f(*args))
    return n
@d
def p(a, t):
    return a + a*t 
print(p(100,0))

a) 100
b) $100
c) $0
d) 0

18 / 60

In order to store values in terms of key and value we use what core data type.

19 / 60

Which of the following functions is a built-in function in python?

20 / 60

Is Python case sensitive when dealing with identifiers?

21 / 60

What will be the value of the following Python expression?

float(4+int(2.39)%2)

 

22 / 60

Which one of the following is the use of function in python?

23 / 60

What will be the output of the following Python code?

d = {0: 'a', 1: 'b', 2: 'c'}
for i in d:
    print(i)

 

24 / 60

What is the return value of trunc()?

25 / 60

What will be the output of the following Python code?

t = '%(a)s, %(b)s, %(c)s'
t % dict(a='hello', b='world', c='universe')

26 / 60

Which of the following is not a complex number?

27 / 60

Which of the following is a Python tuple?

28 / 60

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

'%(qty)d more %(food)s' %{'qty':1, 'food': 'spam'}

29 / 60

What will be the output of the following Python code?

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

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

30 / 60

What will be the value of X in the following Python expression?

“`X = 2+9*((3*12)-8)/10“`

31 / 60

What is the order of namespaces in which Python looks for an identifier?

32 / 60

The following is true about python except

33 / 60

Which of the following is incorrect?

34 / 60

What will be the output of the following Python code?

x = ['ab', 'cd']
for i in x:
    i.upper()
print(x)

35 / 60

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

z=set('abc$de')
'a' in z

 

36 / 60

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

tom
dick
harry

 

37 / 60

Which of the following expressions results in an error?

38 / 60

What will be the output of the following Python code?

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

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

39 / 60

‘Bit’ stands for

40 / 60

The expression 2**2**3 is evaluates as: (2**2)**3.

41 / 60

What is the value of the following expression?

“`float(22//3+3/3)“`

42 / 60

To find the decimal value of 1111, that is 15, we can use the function:

43 / 60

Which keyword is used for function in Python language?

44 / 60

Which of the following will run without errors?

45 / 60

What is the order of precedence in python?

46 / 60

What will be the output of the following Python code?

d = {0: 'a', 1: 'b', 2: 'c'}
for x in d.keys():
    print(d[x])

47 / 60

What will be the output of the following Python code?

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

 

48 / 60

What will be the output of the following Python code?

'{0:.2f}'.format(1.234)

49 / 60

Which of the following is not a core data type in Python programming?

50 / 60

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

x = 2
for i in range(x):
    x += 1
    print (x)

 

51 / 60

What will be the output of the following Python code?

class A:
    @staticmethod
    def a(x):
        print(x)
A.a(100)

 

52 / 60

What will be the output of the following Python expression if X = -122?

print("-%06d"%X)

 

53 / 60

Copy – The ______ is the brain of the computer that performs simple arithmetic & logical operations

54 / 60

What will be the value of the following Python expression?

 bin(10-2)+bin(12^4)

55 / 60

What will be the output of the following Python code?

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

56 / 60

What will be the output of the following Python code?

print("abc. DEF".capitalize())

57 / 60

What will be the output of the following Python code?

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

 

58 / 60

What will be the value of x in the following Python expression?

x = int(43.55+2/2)

59 / 60

Operators with the same precedence are evaluated in which manner?

60 / 60

What will be the output of the following Python code?

d = {0, 1, 2}
for x in d:
    print(x)

 

Your score is

The average score is 22%

0%


Discover more from 9jabaz

Subscribe to get the latest posts 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.