Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python 2027 Batch

Total questions: 49

Worksheet time: 49mins

Name
Class
Date
1.

What is the maximum length of a Python identifier?

a)

32

b)

16

c)

128

d)

No fixed length is specified

2.

What will be the output of the following code snippet?

print(2**3 + (5 + 6)**(1 + 1))

a)

129

b)

8

c)

121

d)

None of the above

3.

Which of the following concepts is not a part of Python?

a)

Pointers

b)

Loops

c)

Dynamic Typing

d)

All of the above

4.

Which of the following statements are used in Exception Handling in Python?

a)

Try

b)

Except

c)

Finally

d)

All of the above

5.

Which of the following types of loops are not supported in Python?

a)

For

b)

While

c)

Do-While

d)

None of the above

6.

Which of the following is the proper syntax to check if a particular element is present in a list?

a)

If ele in list

b)

If not ele not in list

c)

Both A and B

d)

None of the above

7.

Which of the following functions converts date to corresponding time in Python?

a)

strptime ( )

b)

strftime ( )

c)

Both A and B

d)

None of the above

8.

An exception is:

a)

an object

b)

a special function

c)

a standard module

d)

an object

9.

Which of the following is false about protected class members?

a)

They begin with one underscore

b)

They can be accessed by subclasses

c)

They can be accessed by name mangling method

d)

They can be accessed within a class

10.

Overriding means changing behaviour of methods of derived class methods in the base class. Is the statement true or false?

a)

True

b)

False

c)

None

d)

May be

11.

What is the output of the following code, if the time module has already been imported?

4 + '3'

a)

NameError

b)

IndexError

c)

ValueError

d)

TypeError

12.

The output of the code shown below is:

int("gprec")

a)

ImportError

b)

ValueError

c)

TypeError

d)

NameError

13.

Can one block of except statements handle multiple exception?

a)

yes

b)

no

c)

yes, like except TypeError, SyntaxError [,…].

d)

yes, like except [TypeError, SyntaxError].

14.

Which of the following function used to create window in

python tkinter.

a)

window()

b)

tk()

c)

toolkit()

d)

wd()

15.

Which of the following attribute used to change the text

color of a Label widget in python tkinter

a)

fg

b)

foreground

c)

bg

d)

background

16.

Which function is used to set the size of the tkinter

window?

a)

setsize()

b)

size()

c)

geometry()

d)

dimension()

17.

What is the use of mainloop() function in tkinter window?

a)

To create the window screen

b)

To hold the window screen

c)

To delete the window screen

d)

To disable the window screen

18.

In MVC pattern, the model is responsible for

a)

processing the program's data

b)

managing the program's data

c)

displaying the program's data

d)

control the appearance of data

19.
The socket model was based on:
a)
Berkeley Software Distribution
b)
Microsoft architecture
c)
Linux architecture
d)
Unix programming model
20.
Sockets are different from ports because
a)
They included IP addresses
b)
They are in the Application Layer
c)
They use the OSI model
d)
They are just another term for the same thing
21.
TCP socket programming is:
a)
connection-oriented
b)
connectionless
c)
dependent on the host operating system
d)
dependent on the client operating system
22.
User-defined socket programming occurs with ports
a)
>256
b)
>1024
c)
>32K
d)
Any may be used
23.
Multi-thread socket programming allows for
a)
Servers to connect with multiple clients
b)
Clients to connect to multiple servers simultaneously
c)
Both of these
d)
Neither of th
24.

Which is not a meta character

a)

*

b)

%

c)

/

d)

\

25.

functions that belongs to regular expression module

a)

findall

b)

match

c)

search

d)

All the above

26.

[^pqr] returns a

a)

Match for characters p, q, r, P, Q and R only

b)

Match for characters p, q, and r only

c)

Match for any character contain p, q, and r

d)

Match for any character except p, q, and r

27.

Which returns a match for any alphabetic lower or upper case character between a and z.

a)

[a-z]

b)

[a-z-A-Z]

c)

[a-z][A-Z]

d)

[azAZ]

28.

What is the output of the below python program

import re

str = "now a days techies are available in different technologies"

Myvar = re.findall("tech", str)

print(Myvar)

a)

['tech'], ['tech']

b)

['tech'][2]

c)

[2]['tech']

d)

['tech', 'tech']

29.

re.purge() is used to

a)

Search for exact match

b)

Clear the cache

c)

Split the string

d)

search for numbers

30.

When will the else part of try-except-else be executed?

a)

always

b)

when an exception occurs

c)

when no exception occurs

d)

never

31.

A word that tells more about verbs, verb phrases is known as

a)

Adjective

b)

Adverb

c)

Pronoun

d)

Verb

32.

Which type of adverb shows or tells you how or in what way an action is done?

a)

Adverb of Place

b)

Adverb of Manner

c)

Adverb of Time

d)

Adverb of Frequency

33.

Which adverb tells or shows you WHEN an action took place?

a)

Adverb of Manner

b)

Adverb of Place

c)

Adverb of Frequency

d)

Adverb of Time

34.

"I came early this morning". Which type of adverb is this?

a)

Manner

b)

Time

c)

Frequency

d)

Degree

35.

Which sentence is an example of Adverb of Frequency?

a)

Mary is very beautiful

b)

I have already seen this movie.

c)

I always go to work on time

d)

It was so hot, I almost fainted

36.

What is an adjective?

a)

Naming words

b)

Action words

c)

Describing words

d)

Doing words

37.

In the following mark the types of adjectives

a)

Demonstrative

b)

Compound

c)

Interrogative

d)

Possessive

e)

Quantitative

38.

What the three forms of Adjective

a)

Positive, Negative, Neutral

b)

Positive, Subtractive, Multiplicative

c)

Present, Past, Future

d)

Positive, Comparative, Superlative

39.

What are Special Adjectives?

a)

Adjectives having special meaning

b)

Adjectives having two possible forms of comparison

c)

Adjectives having one possible comparison

d)

Adjectives having NO possible comparison

40.

What is the comparative of Difficult

a)

Most Difficult

b)

Difficulter

c)

Difficultest

d)

More Difficult

41.

What is the superlative of Bad?

a)

Better

b)

Best

c)

Worse

d)

Worst

42.

what is the comparative and superlative of Clever?

a)

Cleverer & Cleverest

b)

Clevers & Cleveress

c)

More Clever & Most Clever

d)

More Cleverer & Most Cleverest

43.

Which one of these are Irregular Adjectives?

a)

Difficult

b)

Beautiful

c)

Much

d)

Polite

44.

Adjectives answers to which type of questions?

a)

When? How? What?

b)

Which? Where? Whom?

c)

What Kind? Which one? How Many?

d)

Whose this? How to? When to?

45.

How many students in your class come from Korea?

a)

came

b)

come

c)

comes

d)

are coming

46.

Enter Your Name

4 lines
47.

Enter Your Enrolment No

4 lines
48.

Enter Your Branch(CSE, CSE-AIML, CSE-DS, CSIT, IT, CY)

4 lines
49.

Enter Your Acropolis Email ID

4 lines