Is it possible to safely check if a class/object has a certain attribute?
Answer : B
Reference:
https://stackoverflow.com/questions/610883/how-to-know-if-an-object-has-an-attribute-in-python
The first parameter of each method:
Answer : D
Reference:
https://pythontips.com/2013/08/07/the-self-variable-in-python-explained/
The simplest possible class definition in Python can be expressed as:
Answer : A
Reference:
https://docs.python.org/3/tutorial/classes.html
If you want to access an exception objectג€™s components and store them in an object called e, you have to use the following form of exception statement:
Answer : C
Reference:
https://stackoverflow.com/questions/32613375/python-2-7-exception-handling-syntax
A variable stored separately in every object is called:
Answer : D
There is a stream named s open for writing. What option will you select to write a line to the stream?
Answer : A
Reference:
https://en.wikibooks.org/wiki/Python_Programming/Input_and_Output
You are going to read just one character from a stream called s. Which statement would you use?
Answer : D
Reference:
https://stackoverflow.com/questions/510357/python-read-a-single-character-from-the-user
What can you deduce from the following statement? (Choose two.)
Answer : AD
The following class hierarchy is given. What is the expected out of the code?
Answer : D
Pythonג€™s built in function named open () tries to open a file and returns:
Answer : C
Which of the following words can be used as a variable name? (Choose two.)
Answer : CD
Reference:
https://www.pluralsight.com/guides/python-basics-variables-assignment
Python strings can be ג€gluedג€ together using the operator:
Answer : D
Reference:
https://docs.python.org/3/tutorial/introduction.html
A keyword (Choose two.)
Answer : BC
Reference:
https://www.programiz.com/python-programming/keywords-identifier
How many stars (*) does the snippet print?
Answer : A
Which line can be used instead of the comment to cause the snippet to produce the following expected output? (Choose two.)
Expected output:
1 2 3
Code:
Answer : AC
Have any questions or issues ? Please dont hesitate to contact us