Connect with us

ACADEMICS

OAU CSC 201 Practice Quiz

Published

on

/60
0 votes, 0 avg
0
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

Is Python code compiled or interpreted?

2 / 60

‘Bit’ stands for

3 / 60

What will be the output of the following Python code?

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

4 / 60

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

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

 

5 / 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")

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

 

7 / 60

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

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

8 / 60

What will be the output of the following Python expression?

round(4.576)

 

9 / 60

The one’s complement of 110010101 is:

10 / 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")

11 / 60

What will be the output of the following Python function?

len(["hello",2, 4, 6])

a) Error
b) 6
c) 4
d) 3

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

 

 

13 / 60

What will be the output of the following Python code?

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

14 / 60

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

15 / 60

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

16 / 60

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

a='hello'
q=10
vars()

 

17 / 60

What will be the output of the following Python code?

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

 

18 / 60

Which of the following variable naming is correct

19 / 60

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

print("%-06d"%x)

 

20 / 60

A function with parameters cannot be decorated.

21 / 60

Which module in the python standard library parses options received from the command line?getarg
b) getopt
c) main
d) os

22 / 60

What will be the output of the following Python code?

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

23 / 60

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

tom
dick
harry

 

24 / 60

What will be the value of the following Python expression?

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

25 / 60

Which keyword is used for function in Python language?

26 / 60

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

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

28 / 60

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

x=3.3456789
'%s' %x, str(x)

 

29 / 60

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

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

 

30 / 60

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

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

31 / 60

What will be the output of the following Python code?

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

 

32 / 60

What is the value of the following expression?

8/4/2, 8/(4/2)

 

33 / 60

Which of the following is an invalid statement?

34 / 60

Machines developed in mechanical era include the following except

35 / 60

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

x = int(43.55+2/2)

36 / 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")

 

37 / 60

The expression

“`2**2**3“` is equal to “`(2**2)**3“`

38 / 60

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

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

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

40 / 60

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

41 / 60

What will be the output of the following two codes?

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

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

43 / 60

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

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

44 / 60

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

45 / 60

What are the two main types of functions in Python?

46 / 60

What will be the output of the following Python code?

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

47 / 60

Which type of Programming does Python support?

48 / 60

What will be the output of the following Python code?

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

49 / 60

What will be the output of the following Python code?

'{0:f}, {1:2f}, {2:05.2f}'.format(1.23456, 1.23456, 1.23456)

 

50 / 60

What will be the output of the following Python statement?

  1. >>>"a"+bc

 

51 / 60

What will be the output of the following Python code?

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

 

52 / 60

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

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

53 / 60

What will be the output of the following Python code?

True = False
while True:
    print(True)
    break

54 / 60

The formatting method {1:<10} represents the ___________ positional argument, _________ justified in a 10 character wide field.

55 / 60

What is the output of print 0.1 + 0.2 == 0.3?

56 / 60

Is Python case sensitive when dealing with identifiers?

57 / 60

All keywords in Python are in _________

58 / 60

Which one of these is floor division?

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

60 / 60

Python was created in what year

reCAPTCHA field is required please complete!

Your score is

The average score is 0%

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.