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 is a Python tuple?

2 / 60

What will be the output of the following Python code?

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

 

3 / 60

It is not possible for the two’s complement value to be equal to the original value in any case.

 

4 / 60

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

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

5 / 60

Python was created in what year

6 / 60

What will be the output of the following Python code?

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

 

7 / 60

What will be the output of the following Python code?

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

8 / 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])

9 / 60

6. In python we do not specify types, it is directly interpreted by the compiler, so consider the following operation to be performed.

  1.  >>>x = 13 ? 2

objective is to make sure x has a integer value, select all that apply (python 3.xx)

10 / 60

What will be the output of the following Python code?

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

11 / 60

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

a='hello'
q=10
vars()

 

12 / 60

What will be the output of the following Python code?

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

13 / 60

What will be the output of the following Python code?

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

 

14 / 60

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

print("-%06d"%X)

 

15 / 60

Which of the following is the truncation division operator?

16 / 60

Machines developed in mechanical era include the following except

17 / 60

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

print("%.2f"%x)

18 / 60

What are the values of the following Python expressions?

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

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

“` 2**3**2“`

19 / 60

The output of which of the codes shown below will be: “There are 4 blue birds.”?

 

20 / 60

Which of the following results in a SyntaxError?

21 / 60

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

  1. def example(a):
  2.     a = a + '2'
  3.      a = a*2
  4.     return a
  5. >>>example("hello")

22 / 60

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

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

 

23 / 60

Operating Systems includes the following except

24 / 60

What will be the output of the following Python code?

True = False
while True:
    print(True)
    break

25 / 60

What error occurs when you execute the following Python code snippet?

apple = mango

 

26 / 60

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

print(“%06d”%X)

27 / 60

Is Python code compiled or interpreted?

28 / 60

What will be the output of the following Python code?

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

29 / 60

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

x & y

 

30 / 60

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

31 / 60

‘Bit’ stands for

32 / 60

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

for i in '':
    print (i)

33 / 60

What will be the output of the following Python code?

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

34 / 60

The following are program elements except

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

 

36 / 60

What will be the output of the following Python code?

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

 

37 / 60

The ______ symbol along with the name of the decorator function can be placed above the definition of the function to be decorated works as an alternate way for decorating a function.

 

38 / 60

What will be the output of the following Python code?

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

 

39 / 60

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

not(10<20) and not(10>30)

 

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

41 / 60

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

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

42 / 60

Which of the following formatting options can be used in order to add ‘n’ blank spaces after a given string ‘S’?

 

c

 

43 / 60

Which of the following is the use of id() function in python?

44 / 60

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

45 / 60

Which type of Programming does Python support?

46 / 60

What will be the output of the following Python program?

def foo(x):
    x[0] = ['def']
    x[1] = ['abc']
    return id(x)
q = ['abc', 'def']
print(id(q) == foo(q))

47 / 60

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

'%d %s %g you' %(1, 'hello', 4.0)

48 / 60

What will be the output of the following Python code?

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

 

49 / 60

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

  1. >>>grade1 = 80
  2. >>>grade2 = 90
  3. >>>average = (grade1 + grade2) / 2

50 / 60

Is Python case sensitive when dealing with identifiers?

51 / 60

Python was created in what year

52 / 60

What will be the output of the following Python code?

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

53 / 60

The following are high-level languages except

54 / 60

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

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

56 / 60

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

print("%-06d"%x)

 

57 / 60

What will be the output of the following Python code?

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

 

58 / 60

What is the order of precedence in python?

59 / 60

What is output of print(math.pow(3, 2))?

60 / 60

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

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

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.