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

The following are program elements except

2 / 60

What data type is the object below?

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

3 / 60

A function with parameters cannot be decorated.

4 / 60

Which of the following is an invalid variable?

5 / 60

What does pip stand for python?

6 / 60

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

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

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?

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

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

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

11 / 60

What will be the output of the following Python expression?

“`round(4.576)“`

12 / 60

What will be the output of the following Python code?

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

a) 1 2
b) 1 2 3
c) error
d) none of the mentioned

13 / 60

The following are python reserved words excerpt

14 / 60

What will be the output of the following Python expression?

print(4.00/(2.0+2.0))

 

15 / 60

Mathematical operations can be performed on a string.

16 / 60

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

17 / 60

What will be the output of the python code shown below for various styles of format specifiers?

x=1234
res='integers:...%d...%-6d...%06d' %(x, x, x)
res

18 / 60

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

“`grade1 = 80“`

“`grade2 = 90“`

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

19 / 60

What will be the output of the following Python expression?

0x35 | 0x75

20 / 60

The expression shown below results in an error.

print("-%5d0",989)

a) True
b) False

21 / 60

What will be the output of the following Python code?

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

22 / 60

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

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

24 / 60

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

25 / 60

Who developed Python Programming Language?

26 / 60

What will be the output of the following Python expression?

4^12

27 / 60

Which is the correct operator for power(xy)?

28 / 60

What will be the output of the following Python code?

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

29 / 60

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

30 / 60

What will be the output of the following Python code?

x = [[0], [1]]
print((' '.join(list(map(str, x))),))

31 / 60

What will be the output of the following Python code?

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

32 / 60

The outcome of a programming activity is a _________

33 / 60

What will be the output of the following Python code?

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

 

34 / 60

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

35 / 60

Which of the following is the truncation division operator?

36 / 60

What will be the output of the following Python code?

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

 

37 / 60

What will be the value of x in the following Python expression, if the result of that expression is 2?

x>>2

 

38 / 60

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

39 / 60

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

['hello', 'morning'][bool('')]

 

40 / 60

Which of the following is an invalid statement?

41 / 60

What will be the output of the following Python code?

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

42 / 60

What will be the output of the following Python code?

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

43 / 60

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

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

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

45 / 60

What will be the value of the following Python expression?

float(4+int(2.39)%2)

 

46 / 60

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

47 / 60

What will be the output of the following Python code?

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

48 / 60

What will be the output of the following Python code?

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

49 / 60

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

x<<2

 

50 / 60

What will be the output of the following Python code?

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

51 / 60

The following python code can work with ____ parameters.

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

 

 

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

 

53 / 60

What will be the output of the following Python code?

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

 

54 / 60

What are the two main types of functions in Python?

55 / 60

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

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

56 / 60

What will be the output of the following Python expression?

round(4.576)

 

57 / 60

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

'%(qty)d more %(food)s' %{'qty':1, 'food': 'spam'}

58 / 60

What are the two main types of functions in Python?

59 / 60

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

60 / 60

What will be the output of the following Python expression?

int(1011)?

Your score is

The average score is 22%

0%


Discover more from 9jabaz

Subscribe to get the latest posts to your email.

Advertisement
Comments