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 are python reserved words excerpt

2 / 60

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

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

 

3 / 60

Which of the following is not a complex number?

4 / 60

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

for i in '':
    print (i)

5 / 60

Is Python case sensitive when dealing with identifiers?

6 / 60

What will be the output of the following Python expression?

bin(29)

 

7 / 60

What will be the output of the following Python code?

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

 

8 / 60

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

9 / 60

What will be the output of the following Python code?

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

 

10 / 60

What is the type of inf?

11 / 60

Which of the following is a feature of Python DocString?

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

 

13 / 60

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

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

14 / 60

What are the two main types of functions in Python?

15 / 60

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

16 / 60

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

x>>2

 

17 / 60

What will be the output of the following Python code?

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

 

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

19 / 60

What does 3 ^ 4 evaluate to?

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

What is the order of precedence in python?

22 / 60

What will be the output of the following Python code?

True = False
while True:
    print(True)
    break

23 / 60

What will be the value of the following Python expression?

4 + 3 % 5

 

24 / 60

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

print("%.2f"%x)

25 / 60

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

26 / 60

Python was created in what year

27 / 60

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

apple = mango

 

28 / 60

Which of the following expressions results in an error?

29 / 60

The value of the expressions 4/(3*(2-1)) and 4/3*(2-1) is the same.

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

31 / 60

What will be the output of the following Python code?

l=list('HELLO')
p=l[0], l[-1], l[1:3]
'a={0}, b={1}, c={2}'.format(*p)

 

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

 

33 / 60

The two snippets of the following Python codes are equivalent.

CODE 1
  @f
def f1():
        print(“Hello”)
CODE 2
  def f1():
         print(“Hello”)
f1 = f(f1)

a) True
b) False

34 / 60

What will be the value of the following Python expression?

4+2**5//10

35 / 60

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

8.

36 / 60

What will be the output of the following Python code?

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

37 / 60

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

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

39 / 60

What will be the output of the following Python code?

  1. class tester:
  2.     def __init__(self, id):
  3.         self.id = str(id)
  4.         id="224"
  5. 
    
  6. >>>temp = tester(12)
  7. >>>print(temp.id)

a)

40 / 60

Which of the following functions can help us to find the version of python that we are currently working on?

41 / 60

Which of the following is an invalid statement?

42 / 60

The correct sequence of the history of modern era is

43 / 60

Which is the correct operator for power(xy)?

44 / 60

What is the result of cmp(3, 1)?

45 / 60

Which of the following is a Python tuple?

46 / 60

Is Python code compiled or interpreted?

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

 

48 / 60

What will be the output of the following Python code?

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

49 / 60

The one’s complement of 110010101 is:

50 / 60

Identify the decorator in the snippet of code shown below.

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

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

52 / 60

What will be the output of the following two codes?

i. '{0}'.format(4.56)
ii. '{0}'.format([4.56,])

53 / 60

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

54 / 60

In flow charts, a terminal is represented with what shape

55 / 60

What is the order of precedence in python?

56 / 60

Which one of the following has the highest precedence in the expression?

57 / 60

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

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

58 / 60

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

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

 

59 / 60

What will be the output of the following Python code?

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

60 / 60

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

x=3.3456789
'%-6.2f | %05.2f | %+06.1f' %(x, x, 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.