Python V1
Python V2
Python V3
Python V4
Python V5
100

 Who developed Python Programming Language?

a) Wick van Rossum

b) Rasmus Lerdorf

c) Guido van Rossum 

d) Niene Stom

Who is Guido van Rossum?

Guido van rossum was a software engineer that built python during christmas 

 

100

What will be the output of the following Python statement?

 >>>"a"+"bc"

 a) bc

b) abc

c) ad

d) bca

What is abc?


because it is in alphabetical order

100

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

a) 9.0

b) None

c) 9

Is it 9?

9 because python use functions like this find it

100

What is the output of the following code

print(bool(0), bool(3.14159), bool(-3), bool(1.0+1j))

a) False True False True

b) True True False True

c) True True False True

d) False True True True

What is False True False True? 

 because it is to much and it is using booleans

100

Which of the following is an invalid variable?

a) my_string_1

b) 1st_string

c) foo

d) _

Is it 1st_string? 

1st_string because when i tested it is showed errors

200

Which type of Programming does Python support?

a) object-oriented programming

b) structured programming

c) functional programming

d) all of the above

What is all of the above?

because python uses functions.

200

Which of the following is a feature of Python DocString?

a) In Python all functions should have a docstring

b) Docstrings can be accessed by the __doc__ attribute on objects

c) It provides a convenient way of associating documentation with Python modules, functions, classes, and methods

d) All of the mentioned

What is Docstrings can be accessed by the __doc__ attribute on objects?

Because if you can use __main__ if you type __doc__ it wil pop up on pycharm

200

What will be the value of the result?

list1 = [1,2,3,4]

list2 = [2,4,5,6]

list3 = [2,6,7,8]

result = list()

result.extend(i for i in list1 if i not in (list2+list3) and i not in result)

result.extend(i for i in list2 if i not in (list1+list3) and i not in result)

result.extend(i for i in list3 if i not in (list1+list2) and i not in result)

a) [1, 3, 5, 7, 8]

b) [1, 7, 8]

c) [1, 2, 4, 7, 8]

d) error

Is it [1, 2, 4, 7, 8]?

 because its starting from 1 to 2 to 4 the to a 7  then 8

200

What is the data type of print(type(0xFF))

a) number

b) hexint

c) hex

d) int

What is int?

Int because 0xFF is 255

200

Which of the following is not a keyword?

a) eval

b) assert

c) nonlocal

d) pass

Is it nonlocal?


Nonlocal because local would be one

300

 Is Python case-sensitive when dealing with identifiers?

a) no

b) yes             

c) machine dependent

d) none of the mentioned

Is it no?

because python senses variables as identifiers.

300

What will be the output of the following Python code?

name = ‘Philip’

other_name = ‘Mike’

print(f"Hello {name} and {other_name}").

a) Hello Philip and Mike

b) Error

c) Hello foo and bin

d) None of the mentioned

What is Hello Philip and Mike?

Because to make that work you need formatted strings

300

What is the data type of the following

aTuple = (1, 'Jhon', 1+3j)

print(type(aTuple[2:3]))

a) listed

b)complex

c) tuple

What is a tuple?

 because a tuple would look like that

300

In Python 3, what is the output of type(range(5)). (What data type it will return).

a) int

b) list

c) range

d) None

Is it Range?

Range because a range function would look like that

300

All keywords in Python are in _________

a) lower case

b) UPPER CASE

c) Capitalized

d) None of the mentioned

Is it Capitalized?

Capitalized because UPPER CASE IS CAPITALIZED

400

Select the right way to create a string literal Ault'Kelly

a) str1 = 'Ault\\'Kelly'

b)str1 = 'Ault\'Kelly'

c)str1 = """Ault'Kelly"""

What is str1 = 'Ault\'Kelly'?

because if you put 1 \ its ok.

400

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

a) 79 characters

b) 31 characters

c) 63 characters

d) none of the mentioned

Is it 63?

63 characters because if you  use 79 that would be too much

400

What is the data type of print(type(10))

a) float

b)int

c) whole number

What is int?

because integers(int) use numbers

400

Which of the following is the correct extension of the Python file?

a) .python

b) .pl

c) .py

d) .p

Is it .py?

.py because if it was the others it will just cause errors

400

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

a) unlimited length

b) all private members must have leading and trailing underscores

c) underscore and ampersand are the only two special characters allowed

d) none of the mentioned

Is it unlimited length?


500

What is the output of print(type({}) is set)

a) True

b) False

Is it True?

True because the output of it will print

500

What will be the output of the following Python expression?

round(4.576)

a) 4

b) 4.6

c) 5

d) 4.5

Is it 4.6?

4.6 because python uses math to find the answer

500

What is the result of print(type([]) is list) 

a) False

b) True

Is it False?

False because type({}) would print as an output

500

Is Python code compiled or interpreted?

a) Python code is both compiled and interpreted

b) Python code is neither compiled nor interpreted

c) Python code is only compiled

d) Python code is only interpreted

Is it Python code is only interpreted?

Python is interpreted because I only see pycharm say it is interpreted

500

Which of the following is an invalid statement?

a) abc = 1,000,000

b) a b c = 1000 2000 3000

c) a,b,c = 1000, 2000, 3000

d) a_b_c = 1,000,000

Is it a b c = 1000 2000 3000?

because that variable is in spaces

M
e
n
u