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

Which of the following character is used to give single-line comments in Python?

2 / 60

What will be the output of the following Python expression?

0x35 | 0x75

3 / 60

What will be the output of the following Python code?

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

4 / 60

The following python program can work with ____ parameters.

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

 

5 / 60

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

6 / 60

What is the value of the following expression?

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

 

7 / 60

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

8 / 60

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

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

9 / 60

What are the values of the following Python expressions?

“` 2**(3**2)“`

“` (2**3)**2“`

“` 2**3**2“`

10 / 60

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

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

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

x<<2

 

13 / 60

What will be the output of the following Python code?

'%s' %((1.23,),)

 

14 / 60

What will be the output of the following Python code?

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

15 / 60

What is the return type of function id?

16 / 60

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

17 / 60

What is output of print(math.pow(3, 2))?

18 / 60

What is the result of cmp(3, 1)?

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

20 / 60

What does pip stand for python?

21 / 60

The following python code can work with ____ parameters.

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

 

 

22 / 60

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

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

23 / 60

Which of the following will run without errors?

24 / 60

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

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

25 / 60

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

print("%.2f"%x)

26 / 60

What will be the output of the following Python code?

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

 

Control does not enter the loop because of False.

27 / 60

Which one of the following has the same precedence level?

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

What will be the value of the following Python expression?

4+2**5//10

30 / 60

Which of the following is an invalid variable?

31 / 60

Evaluate the expression given below if A = 16 and B = 15.

A % B // A

a) 0.0
b) 0
c) 1.0
d) 1

32 / 60

Who developed Python Programming Language?

33 / 60

Which is the correct operator for power(xy)?

34 / 60

Which of the following is incorrect?

35 / 60

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

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

 

36 / 60

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

37 / 60

Is Python case sensitive when dealing with identifiers?

38 / 60

What will be the output of the following Python expression if x=15 and y=12?

x & y

 

39 / 60

What will be the output of the following Python code?

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

40 / 60

Python was created in what year

41 / 60

Which of the following is the use of id() function in python?

42 / 60

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

not(3>4)
not(1&1)

I

   True
   True

II

   True
   False

III

   False
   True

IV
   False
   False

Which of the answers from I - IV is correct?

43 / 60

A function with parameters cannot be decorated.

44 / 60

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

x<<2

 

45 / 60

Which of the following is the truncation division operator?

46 / 60

What will be the output of the following Python program?

  1. def addItem(listParam):
  2.     listParam += [1]
  3. 
    
  4. mylist = [1, 2, 3, 4]
  5. addItem(mylist)
  6. print(len(mylist))

47 / 60

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

print(“%f”%x)

 

 

48 / 60

What will be the output of the following Python expression?

4^12

49 / 60

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

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

50 / 60

What will be the value of the following Python expression?

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

51 / 60

Machines developed in mechanical era include the following except

52 / 60

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

53 / 60

What will be the output of the following Python code?

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

 

54 / 60

The outcome of a programming activity is a _________

55 / 60

What will be the output of the following Python code?

s='{0}, {1}, and {2}'
s.format('hello', 'good', 'morning')

 

56 / 60

What will be the output of the following two codes?

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

57 / 60

What will be the output of the following Python function?

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

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

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

 

59 / 60

Select all options that print.

hello-how-are-you

 

60 / 60

A computer software comprises of ___________ software & ___________ software

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.