pythonMCQ (1)
pythonMCQ (1)
Options:
A. James Gosling
B. Steve Jobs
C. Dennis Ritchie
Options:
A. Statically
B. Dynamically
C. English
Options:
A. Procedure Oriented
B. Object Oriented
C. Interpreted
D. Platform Dependent
Options:
A. .pyc
B. .py
C. .python
D. .p
Q5) What command should be used to run python program assuming the name of program is
Hello.py ?
Options:
A. python Hello.py
B. py Hello.py
C. pyc Hello
D. python Hello
Q1) you develop a python application for your company. You want to add notes to your code so
other team members will understand it. What should you do?
Options:
B. Place the notes after the last line of code separated by a blank line
C. Place the notes before the first line of code separated by a blank line
Q2) You create a function to calculate the power of a number by using Python Practice Test. You
need to ensure that the function ¡s documented with comments. You create the following code.
Line numbers are included for reference only.
For each of the following statements, select Yes if the statement is true. Otherwise, select No.
Options: Yes No
Options:
A. Returns the current balance of the bank account
def get_balance():
return balance
B. def get_balance():
/*Returns the current balance of the bank account*/
return balance
C. //Returns the current balance of the bank account
def get_balance():
return balance
D. def get_balance():
#Returns the current balance of the bank account
return balance
Options:
a) lower case
b) UPPER CASE
c) Capitalized
d) None of the above
Options:
A. try & catch
B. and, or & in
C. while & do
D. if, elif , elseif & else
Options:
A. True & False
B. try, except & finally
C. is, not & or
D. break, continue & exit
Q7) Which of the following is invalid identifier rules? Select all that apply.
Options:
A. Name can contain $.
B. Name can begin with digit.
C. Keyword cannot be used as identifiers.
D. Names are case sensitive
Options:
a) my_string_1
b) 1st_string
c) repeat
d) _
A) type(+1E10)
B) type(5.0)
C) type(“True”)
D) type(False)
Q10) You are writing a Python Program. The program collects customer data and stores it in a
database. You need to ensure that the program handles the data correctly so it can be stored in
the database correctly