Python Exam with 100% correct answers
rated A+ (7)
Which of the following is correct about Python?
a. Python is a high-level, interpreted, interactive and object-oriented scripting language.
b. Python is designed to be highly readable.
c. It uses English keywords frequently where as other languages use punctuation, and it has fewer
syntactical constructions than other languages.
d. All of the above - correct answer ✔✔d. All of the above.
Is Python case sensitive when dealing with identifiers?
a. yes
b. no
c. it depends on context
d. it depends on data type - correct answer ✔✔a. yes
Which of the following is an invalid variable?
a. my_string
b. __a
c. 1st_string
d. foo_24 - correct answer ✔✔c. 1st_string
All keywords in Python are in
a. lower case
, b. UPPER CASE
c. Capitalized
d. None of the above - correct answer ✔✔d. None of the above
______________(str) is the function to run in the shell to find out details about how to use str() and the
type of data it accepts and returns. - correct answer ✔✔help
Which of the following is an invalid statement?
a. abc = 1,000,000
b. a b c = 1000 2000 3000
c. a,b,c = 1, 2, 3
d. a_b_c = 4,000,000 - correct answer ✔✔b. a b c = 1000 2000 3000
Which one of the following have the highest precedence in the expression?
a. Exponential
b. Addition
c. Multiplication
d. Parentheses - correct answer ✔✔d. Parentheses
Following set of commands are executed in shell, what will be the output?
>>> str = "hello"
>>> str[:2]
>>> - correct answer ✔✔he; because you are printing only the first two bytes of string.
The following is displayed after a print() call:
tom
dick
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller Sakayobako30. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $12.99. You're not tied to anything after your purchase.