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

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

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

 

2 / 60

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

x=3.3456789
'%f | %e | %g' %(x, x, x)

3 / 60

What will be the output of the following Python function?

min(max(False,-3,-4), 2,7)

 

4 / 60

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

5 / 60

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

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

6 / 60

What will be the output of the following Python code?

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

7 / 60

Machines developed in mechanical era include the following except

8 / 60

What will be the output of the following Python code?

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

 

9 / 60

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

10 / 60

What will be the output of the following Python code?

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

 

11 / 60

What is the order of precedence in python?

12 / 60

What will be the output of the following Python code?

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

 

13 / 60

What will be the output of the following Python code?

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

14 / 60

What will be the output of the following Python code?

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

 

15 / 60

What will be the output of the following Python expression?

print(4.00/(2.0+2.0))

 

16 / 60

What will be the output of the following Python code?

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

17 / 60

‘Bit’ stands for

18 / 60

What will be the output of the following Python code?

s='%s, %s & %s'
s%('mumbai', 'kolkata', 'delhi')

19 / 60

What will be the output of the following Python code?

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

20 / 60

What is the value of the following expression?

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

21 / 60

Machines developed in transistor era include the following except

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

23 / 60

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

a='hello'
q=10
vars()

 

24 / 60

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

for i in 'abcd'[::-1]:
    print (i)

25 / 60

What will be the output of the following Python code?

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

26 / 60

Which of these is the definition for packages in Python?

27 / 60

What will be the output of the following Python expression?

“`round(4.576)“`

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

29 / 60

To find the decimal value of 1111, that is 15, we can use the function:

30 / 60

In flow charts, a terminal is represented with what shape

31 / 60

Which of the following is an invalid variable?

32 / 60

What will be the output of the following Python code?

def d(f):
    def n(*args):
        return '$' + str(f(*args))
    return n
@d
def p(a, t):
    return a + a*t 
print(p(100,0))

a) 100
b) $100
c) $0
d) 0

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

34 / 60

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

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

35 / 60

What will be the output of the following Python code?

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

36 / 60

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

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

37 / 60

Which of the following represents the bitwise XOR operator?

38 / 60

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

“`grade1 = 80“`

“`grade2 = 90“`

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

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

 

40 / 60

Which keyword is used to call a function in Python language?

41 / 60

What will be the output of the following Python code?

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

42 / 60

What will be the output of the following Python code?

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

43 / 60

Which keyword is used for function in Python language?

44 / 60

Which type of Programming does Python support?

45 / 60

What will be the output of the following Python code?

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

46 / 60

The expression shown below results in an error.

print("-%5d0",989)

a) True
b) False

47 / 60

What data type is the object below?

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

48 / 60

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

49 / 60

What will be the output of the following Python code?

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

50 / 60

What will be the output of the following Python code?

>>>print (r"\nhello")

51 / 60

What will be the output of the following Python function?

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

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

52 / 60

A function with parameters cannot be decorated.

53 / 60

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

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

54 / 60

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

55 / 60

What will be the output of the following Python function?

def f(p, q):
	return p%q
f(0, 2)
f(2, 0)



                            

56 / 60

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

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

58 / 60

What will be the output of the following Python code?

def foo():
    try:
        return 1
    finally:
        return 2
k = foo()
print(k)

 

59 / 60

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

60 / 60

Which of the following operators has its associativity from right to left?

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.