Connect with us

ACADEMICS

OAU CSC 201 Practice Quiz

Published

on

/60
3 votes, 3.3 avg
570
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 is the result of cmp(3, 1)?

2 / 60

What is the order of namespaces in which Python looks for an identifier?

3 / 60

What will be the output of the following Python code?

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

 

4 / 60

Machines developed in mechanical era include the following except

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

 

 

6 / 60

Which of the following expressions results in an error?

7 / 60

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

8 / 60

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

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

9 / 60

All keywords in Python are in _________

10 / 60

What will be the output of the following Python expression if the value of x is 34?

print(“%f”%x)

 

 

11 / 60

What will be the output of the following Python program?

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

12 / 60

What will be the output of the following Python expression?

4^12

13 / 60

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

“`grade1 = 80“`

“`grade2 = 90“`

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

14 / 60

Which of the following is not a keyword?

15 / 60

The following python code can work with ____ parameters.

def f(x):
    def f1(*args, **kwargs):
           print("Sanfoundry")
           return x(*args, **kwargs)
    return f1

 

 

16 / 60

What arithmetic operators cannot be used with strings in Python?

17 / 60

What will be the output of the following Python code?

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

18 / 60

What will be the output of the following Python code?

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

19 / 60

What is the value of the following expression?

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

 

20 / 60

What will be the value of the following Python expression?

4 + 3 % 5

 

21 / 60

Which of the following statements is used to create an empty set in Python?

22 / 60

A computer software comprises of ___________ software & ___________ software

23 / 60

What will be the output of the following Python expression?

round(4.576)

 

24 / 60

Which one of these is floor division?

25 / 60

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

26 / 60

Python supports the creation of anonymous functions at runtime, using a construct called __________

27 / 60

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

28 / 60

What will be the output of the following Python code?

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

 

29 / 60

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

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

 

30 / 60

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

31 / 60

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

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

33 / 60

What will be the output of the following Python statement?

  1. >>>"a"+bc

 

34 / 60

What will be the output of the following Python code?

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

35 / 60

What is the return type of function id?

36 / 60

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

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

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

38 / 60

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

39 / 60

What will be the output of the following Python expression?

24//6%3, 24//4//2

 

40 / 60

What will be the output of the following Python code?

True = False
while True:
    print(True)
    break

41 / 60

What will be the output of the following Python code?

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

42 / 60

Which of the following cannot be a variable?

43 / 60

What will be the output of the following Python code if the system date is 21st June, 2017 (Wednesday)?

[] or {}
{} or []

 

44 / 60

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

print(“%06d”%X)

45 / 60

What will be the output of the following Python code?

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

 

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?

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

48 / 60

What will be the output of the following Python code?

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

49 / 60

What is the maximum possible length of an identifier in Python?

50 / 60

Which of the following is not a complex number?

51 / 60

Application software includes the following except

52 / 60

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

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

53 / 60

Why are local variable names beginning with an underscore discouraged?

54 / 60

What will be the output of the following Python code?

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

55 / 60

What will be the output of the following Python code?

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

56 / 60

A function with parameters cannot be decorated.

57 / 60

Which of these is the definition for packages in Python?

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

59 / 60

What is the value of the following expression?

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

60 / 60

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

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.