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

What will be the output of the following Python code?

for i in range(0):
    print(i)

2 / 60

What will be the output of the following Python code?

def f(x):
    def f1(*args, **kwargs):
        print("*", 5)
        x(*args, **kwargs)
        print("*", 5)
    return f1
@f
def p(m):
    p(m)
print("hello")

 

 

3 / 60

To add a new element to a list we use which Python command?

4 / 60

What is the average value of the following Python code snippet?

“`grade1 = 80“`

“`grade2 = 90“`

“`average = (grade1 + grade2) / 2“`

5 / 60

What will be the output of the following Python expression?

0x35 | 0x75

6 / 60

What will be the output of the following Python code?

l=[1, 0, 2, 0, 'hello', '', []]
list(filter(bool, l))

7 / 60

Given a function that does not return any value, What value is thrown by default when executed in shell.

8 / 60

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

9 / 60

Which of the following expressions can be used to multiply a given number ‘a’ by 4?

8.

10 / 60

Which of the following represents the bitwise XOR operator?

11 / 60

What data type is the object below?

L = [1, 23, ‘hello’, 1]

12 / 60

Which of the following is used to define a block of code in Python language?

13 / 60

What will be the output of the following Python code?

x = "abcdef"
i = "a"
while i in x:
    x = x[:-1]
    print(i, end = " ")

14 / 60

Which type of Programming does Python support?

15 / 60

What will be the output of the following Python code?

class Truth:
	pass
x=Truth()
bool(x)

16 / 60

What will be the value of the following Python expression?

4+2**5//10

17 / 60

Which of the following is not a keyword?

18 / 60

‘Bit’ stands for

19 / 60

What will be the output of the following Python code?

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

 

20 / 60

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

21 / 60

What will be the output of the following Python code?

def ordi():
	print("Ordinary")
ordi
ordi()

 

22 / 60

What is the value of the following expression?

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

23 / 60

What will be the output of the following Python statement?

  1. >>>"a"+bc

 

24 / 60

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

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

25 / 60

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

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

26 / 60

What will be the output of the following Python code?

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

 

27 / 60

What will be the output of the following Python code?

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

 

28 / 60

Which of the following is the correct extension of the Python file?

29 / 60

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

print("%-06d"%x)

 

30 / 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')

31 / 60

Which of the following expressions results in an error?

32 / 60

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

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

 

33 / 60

Which of the following is a Python tuple?

34 / 60

What will be the output of the following Python code?

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

35 / 60

What are the values of the following Python expressions?

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

 

36 / 60

Which one of the following is not a keyword in Python language?

37 / 60

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

x = int(43.55+2/2)

38 / 60

What will be the output of the following Python expression?

bin(29)

 

39 / 60

What will be the value of the following Python expression?

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

40 / 60

What will be the output of the following Python expression?

int(1011)?

41 / 60

What are the two main types of functions in Python?

42 / 60

What will be the output of the following Python code?

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

43 / 60

In flow charts, a terminal is represented with what shape

44 / 60

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

print("%.2f"%x)

 

 

45 / 60

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

46 / 60

Which of these in not a core data type?

47 / 60

The one’s complement of 110010101 is:

48 / 60

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

X=”hi”
print(“05d”%X)

49 / 60

Which of the following is invalid?

50 / 60

What are the values of the following Python expressions?

“` 2**(3**2)“`

“` (2**3)**2“`

“` 2**3**2“`

51 / 60

Which type of Programming does Python support?

52 / 60

What will be the output of the following Python code?

print("Hello {0[0]} and {0[1]}".format(('foo', 'bin')))Hello (‘foo’, ‘bin’) and (‘foo’, ‘bin’)
b) Error
c) Hello foo and bin
d) None of the mentioned

53 / 60

Which keyword is used for function in Python language?

54 / 60

What does ~~~~~~5 evaluate to?
a) +5
b) -11
c) +11
d) -5

55 / 60

Identify the decorator in the snippet of code shown below.

def sf():
     pass
sf = mk(sf)
@f
def sf():
     return

56 / 60

What does pip stand for python?

57 / 60

Operators with the same precedence are evaluated in which manner?

58 / 60

What does 3 ^ 4 evaluate to?

59 / 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()

60 / 60

What will be the output of the following Python code?

for i in range(int(2.0)):
    print(i)

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.