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
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
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
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
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
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.
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
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
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
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
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.
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
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
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
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
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.
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
What is the data type of print(type(10))
a) float
b)int
c) whole number
What is int?
because integers(int) use numbers
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
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?
What is the output of print(type({}) is set)
a) True
b) False
Is it True?
True because the output of it will print
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
What is the result of print(type([]) is list)
a) False
b) True
Is it False?
False because type({}) would print as an output
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
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