Getting Started with Python

Chapter 2 (Quiz Answers) | Week-4 | Programming for Everybody (Getting Started with Python) By Coursera

Programming for Everybody (Getting Started with Python)

Coursera
Programming for Everybody (Getting Started with Python)
Week 4
Chapter 2
Graded Quiz • 30 min

1. Which of the following is a comment in Python?

  • # This is a test
  • // This is a test
  • /* This is a test */
  • * This is a test
1.In the following code,
print(98.6)
What is “98.6”?
  • A variable
  • A conditional statement
  • An iteration / loop statement
  • A constant


2.What does the following code print out?
Prrint("123" + "abc")
  • This is a syntax error because you cannot add strings
  • hello world
  • 123abc
  • 123+abc


2. In the following code,
x = 42


What is “x”?
  • A variable
  • A constant
  • A function
  • A Central Processing Unit


3. Which of the following is a bad Python variable name?
  • Spam
  • 23spam
  • SPAM23
  • _spam


4. Which of the following is not a Python reserved word?
  • spam
  • break
  • continue
  • iterate
  • for
  • Speed


5. Assume the variable x has been initialized to an integer value (e.g., x = 3). What does the following statement do?
x = x + 2

  • Retrieve the current value for x, add two to it and put the sum back into x
  • Produce the value “false” because “x” can never equal “x+2”
  • This would fail as it is a syntax error
  • Create a function called “x” and put the value 2 in the function


6. Which of the following elements of a mathematical expression in Python is evaluated first?
  • Addition +
  • Multiplication *
  • Subtraction –
  • Parentheses ( )


7. What is the value of the following expression
42 % 10

    Hint – the “%” is the remainder operator
    • 420
    • 2
    • 1042
    • 10


    8. What will be the value of x after the following statement executes:

    x = 1 + 2 * 3 - 8 / 4

    • 8
    • 2.0
    • 5.0
    • 4


    9. What will be the value of x when the following statement is executed:

    x = int(98.6)

    • 6
    • 98
    • 99
    • 100


    10. What does the Python input() function do?
    • Pause the program and read data from the user
    • Connect to the network and retrieve a web page.
    • Read the memory of the running program
    • Take a screen shot from an area of the screen


    The above questions are from “Programming for Everybody (Getting Started with Python)” You can discover all the refreshed questions and answers related to this on the “Programming for Everybody (Getting Started with Python) By Coursera” page. If you find the updated questions or answers, do comment on this page and let us know. We will update the answerspossible as possible.

    Do Not Only Use These Quizzes For Getting Certificates.You Can Take Help From These Quizzes Answer. All Quizzes & Contents Are Free Of Charge. ✅

    If You Want Any Quiz Answers Then Please Contact Us

    Similar Posts

    Leave a Reply

    Your email address will not be published. Required fields are marked *