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

Which of the following statements is used to create an empty set in Python?

2 / 60

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

3 / 60

What will be the output of the following Python code?

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

4 / 60

Application software includes the following except

5 / 60

What are the values of the following Python expressions?

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

 

6 / 60

What will be the output of the following Python code?

print('*', "abcde".center(6), '*', sep='')

 

7 / 60

What will be the output of the following Python code?

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

8 / 60

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

9 / 60

What will be the output of the following Python code?

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

10 / 60

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

print("%5.2f"%x)

 

11 / 60

What will be the output of the following Python expression?

“`round(4.576)“`

12 / 60

Which of the following Boolean expressions is not logically equivalent to the other three?

 

13 / 60

Mathematical operations can be performed on a string.

14 / 60

What will be the output of the following Python code?

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

15 / 60

What will be the value of x in the following Python expression, if the result of that expression is 2?

x>>2

 

16 / 60

Which of the following is an invalid variable?

17 / 60

Why are local variable names beginning with an underscore discouraged?

18 / 60

What is the order of precedence in python?

19 / 60

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

x = 'abcd'
for i in range(len(x)):
    i[x].upper()
print (x)
c

20 / 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

21 / 60

Which of the following expressions results in an error?

22 / 60

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

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

 

23 / 60

What will be the output of the following Python expression?

int(1011)?

24 / 60

Which of the following character is used to give single-line comments in Python?

25 / 60

A computer software comprises of ___________ software & ___________ software

26 / 60

What will be the output of the following Python code?

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

 

27 / 60

What will be the output of the following Python code if the system date is 21st June, 2017 (Wednesday)?

[] or {}
{} or []

 

28 / 60

Which keyword is used for function in Python language?

29 / 60

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

30 / 60

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

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

31 / 60

What will be the output of the following Python code?

if (9 < 0) and (0 < -9):
    print("hello")
elif (9 > 0) or False:
    print("good")
else:
    print("bad")

 

32 / 60

What will be the output of the following Python code?

>>>list1 = [1, 3]
>>>list2 = list1
>>>list1[0] = 4
>>>print(list2)

33 / 60

What will be the value of the following Python expression?

 

34 / 60

What will be the output of the following Python code?

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

35 / 60

What will be the output of the following Python code?

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

36 / 60

Which of the following is not a complex number?

37 / 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
def a(x):
    def f1(*args, **kwargs):
        print("%"* 5)
        x(*args, **kwargs)
        print("%"* 5)
    return f1
@f
@a
def p(m):
    print(m)
p("hello")

38 / 60

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

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

39 / 60

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

40 / 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

41 / 60

Which of the following is incorrect?

42 / 60

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

43 / 60

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

a='hello'
q=10
vars()

 

44 / 60

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

45 / 60

What will be the output of the following Python code?

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

 

46 / 60

Which of the following is invalid?

47 / 60

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

['hello', 'morning'][bool('')]

 

48 / 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 = " ")

 

49 / 60

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

50 / 60

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

51 / 60

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

52 / 60

What will be the output of the following Python code?

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

 

53 / 60

What will be the output of the following Python code?

x = 123
for i in x:
    print(i)

 

54 / 60

Which of the following character is used to give single-line comments in Python?

55 / 60

What will be the output of the following Python code?

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

 

56 / 60

Which is the correct operator for power(xy)?

57 / 60

What will be the output of the following Python code?

x = [[0], [1]]
print((' '.join(list(map(str, x))),))

58 / 60

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

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

59 / 60

Python was created in what year

60 / 60

What will be the output of the following Python code?

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

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.