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

Mathematical operations can be performed on a string.

2 / 60

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

for i in '':
    print (i)

3 / 60

What will be the output of the following Python code?

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

4 / 60

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

5 / 60

What will be the output of the following two codes?

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

6 / 60

What will be the output of the following Python statement?

  1. >>>"a"+bc

 

7 / 60

Which type of Programming does Python support?

8 / 60

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

9 / 60

Which of these in not a core data type?

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

 

11 / 60

What will be the output of the following Python code?

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

12 / 60

Which one of these is floor division?

13 / 60

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

14 / 60

What does pip stand for python?

15 / 60

What will be the output of the following Python code?

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

16 / 60

What will be the output of the following Python code?

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

17 / 60

What arithmetic operators cannot be used with strings in Python?

18 / 60

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

x<<2

 

19 / 60

Which of the following is the truncation division operator?

20 / 60

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

21 / 60

Which of the following variable naming is correct

22 / 60

What will be the output of the following Python code?

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

23 / 60

Which one of the following is the use of function in python?

24 / 60

What is the value of the following expression?

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

 

25 / 60

What is the order of precedence in python?

26 / 60

Machines developed in mechanical era include the following except

27 / 60

What will be the output of the following Python code?

def ordi():
	print("Ordinary")
ordi
ordi()

 

28 / 60

What will be the output of the following Python code?

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

29 / 60

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

30 / 60

The correct sequence of the history of modern era is

31 / 60

What are the values of the following Python expressions?

 2**(3**2)
 (2**3)**2
 2**3**2

 

32 / 60

Which of the following results in a SyntaxError?

33 / 60

What will be the output of the following Python code?

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

 

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

35 / 60

What will be the value of the following Python expression?

4+2**5//10

36 / 60

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

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

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

Which one of the following has the highest precedence in the expression?

39 / 60

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

40 / 60

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

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

41 / 60

Which of the following expressions results in an error?

42 / 60

The expression shown below results in an error.

print("-%5d0",989)

a) True
b) False

43 / 60

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

f = foo()
format(f)

 

44 / 60

What will be the output of the following Python code?

l=list('HELLO')
p=l[0], l[-1], l[1:3]
'a={0}, b={1}, c={2}'.format(*p)

 

45 / 60

What is the value of the following expression?

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

46 / 60

What is the output of this expression, 3*1**3?

47 / 60

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

48 / 60

What will be the output of the following Python expression?

“`round(4.576)“`

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

 

50 / 60

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

51 / 60

The following is true about python except

52 / 60

What will be the output of the following Python code?

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

53 / 60

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

bool(False)
bool()

I

   True 
   True
II
   False
   True

III

   False
   False

IV

   True
   False

Which of I-IV is correct?

54 / 60

What is the value of the following Python expression?

bin(0x8)

55 / 60

Python was created in what year

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

 

57 / 60

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

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

58 / 60

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

apple = mango

 

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

60 / 60

What will be the value of the following Python expression?

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

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.