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?

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

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

 

3 / 60

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

apple = mango

 

4 / 60

Operating Systems includes the following except

5 / 60

What is the value of the following expression?

2+4.00, 2**4.0

 

6 / 60

In flow charts, a terminal is represented with what shape

7 / 60

The following are program elements except

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

 

9 / 60

What is the answer to this expression, 22 % 3 is?

10 / 60

Which function is called when the following Python program is executed?

f = foo()
format(f)

 

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

12 / 60

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

X=”san-foundry”
print(“%56s”,X)

13 / 60

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

print("%-06d"%x)

 

14 / 60

What will be the output of the following Python code?

['f', 't'][bool('spam')]

a) t
b) f
c) No output
d) Error

15 / 60

What will be the output of the following Python function?

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

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

16 / 60

What will be the output of the following Python code?

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

17 / 60

Operators with the same precedence are evaluated in which manner?

18 / 60

To add a new element to a list we use which Python command?

19 / 60

What will be the output of the following Python code?

def f(x):
    def f1(a, b):
        print("hello")
        if b==0:
            print("NO")
            return
        return f(a, b)
    return f1
@f
def f(a, b):
    return a%b
f(4,0)

20 / 60

What will be the output of the following Python code?

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

21 / 60

A ________ is a sequence of instructions telling the computer what to do.

22 / 60

What will be the output of the following Python code?

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

23 / 60

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

24 / 60

What data type is the object below?

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

25 / 60

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

26 / 60

Which one of these is floor division?

27 / 60

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

28 / 60

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

29 / 60

The following is true about python except

30 / 60

What will be the output of the following Python code?

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

31 / 60

Which of the following is incorrect?

32 / 60

What will be the output of the following Python expression?

4^12

33 / 60

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

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

34 / 60

Which of the following results in a SyntaxError?

35 / 60

What will be the output of the following Python code?

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

 

36 / 60

What will be the output of the following Python code?

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

 

37 / 60

What will be the output of the following Python code?

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

38 / 60

What will be the output of the following Python code?

i = 0
while i < 3:
    print(i)
    i += 1
else:
    print(0)

39 / 60

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

40 / 60

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

“`grade1 = 80“`

“`grade2 = 90“`

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

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

42 / 60

Which of the following Python statements will result in the output: 6?

A = [[1, 2, 3],
     [4, 5, 6],
     [7, 8, 9]]

 

43 / 60

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

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

 

44 / 60

Bitwise _________ gives 1 if either of the bits is 1 and 0 when both of the bits are 1.

45 / 60

The following are python reserved words excerpt

46 / 60

Which of the following is invalid?

47 / 60

Select all options that print.

hello-how-are-you

 

48 / 60

What is the value of the following expression?

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

49 / 60

Which of the following variable naming is correct

50 / 60

What will be the output of the following Python expression?

round(4.576)

 

51 / 60

Machines developed in transistor era include the following except

52 / 60

What will be the output of the following Python code?

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

 

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

54 / 60

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

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

55 / 60

Which of the following is the truncation division operator in Python?

56 / 60

Which of the following is not a keyword?

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

 

 

58 / 60

What will be the output of the following Python code snippet if x=1?

x<<2

 

59 / 60

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

print("%5.2f"%x)

 

60 / 60

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

x = int(43.55+2/2)

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.