Connect with us

ACADEMICS

OAU CSC 201 Practice Quiz

Published

on

/60
3 votes, 3.3 avg
569
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?

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

2 / 60

It is not possible for the two’s complement value to be equal to the original value in any case.

 

3 / 60

Why are local variable names beginning with an underscore discouraged?

4 / 60

What will be the output of the following Python code?

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

5 / 60

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

i. bin((2**16)-1)
ii. '{}'.format(bin((2**16)-1))

6 / 60

What will be the output of the following Python code?

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

 

7 / 60

All keywords in Python are in _________

8 / 60

Which of the following expressions involves coercion when evaluated in Python?

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

10 / 60

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

x = 2
for i in range(x):
    x -= 2
    print (x)

11 / 60

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

12 / 60

Is Python code compiled or interpreted?

13 / 60

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

tom
dick
harry

 

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

15 / 60

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

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

17 / 60

Which of the following Boolean expressions is not logically equivalent to the other three?

 

18 / 60

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

19 / 60

Which of these in not a core data type?

20 / 60

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

21 / 60

Which one of the following has the same precedence level?

22 / 60

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

23 / 60

Which keyword is used for function in Python language?

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

25 / 60

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

26 / 60

What will be the output of the following Python code?

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

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

28 / 60

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

x<<2

 

29 / 60

What will be the output of the following Python code?

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

30 / 60

Python was created in what year

31 / 60

What will be the output of the following Python code?

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

32 / 60

The following is true about python except

33 / 60

What will be the output of the following Python code?

l=list('HELLO')
'first={0[0]}, third={0[2]}'.format(l)

34 / 60

What will be the output of the following Python code?

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

35 / 60

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

x<<2

 

36 / 60

Which of the following is an invalid variable?

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

38 / 60

What will be the output of the following Python expression?

4^12

39 / 60

What will be the output of the following Python code?

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

40 / 60

What will be the output of the following Python code?

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

41 / 60

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

42 / 60

Application software includes the following except

43 / 60

What will be the output of the following Python code?

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

44 / 60

What will be the output of the following Python expression?

bin(29)

 

45 / 60

Operators with the same precedence are evaluated in which manner?

46 / 60

What is the order of precedence in python?

47 / 60

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

48 / 60

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

49 / 60

What will be the output of the following Python code?

def mk(x):
    def mk1():
        print("Decorated")
        x()
    return mk1
def mk2():
    print("Ordinary")
p = mk(mk2)
p()

50 / 60

Which of the following represents the bitwise XOR operator?

51 / 60

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

print("-%06d"%X)

 

52 / 60

What will be the output of the following Python code?

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

53 / 60

What is the type of inf?

54 / 60

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

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

55 / 60

What will be the output of the following Python function?

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

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

56 / 60

The expression

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

57 / 60

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

58 / 60

Operating Systems includes the following except

59 / 60

What will be the value of the following Python expression?

4 + 3 % 5

 

60 / 60

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

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.