A Smarter Way to Learn Python / Chapter 1 Exercises

  • Index of exercises
  • Email me

1

2

3

4

5

6

7

8

9

10

11

12

 

Congratulations. You've aced all the exercises for this chapter.


To practice on your own, or to check code you believe shouldn't have been scored as incorrect, go to Trinket.


Post a review on Amazon for the paperback or the Kindle edition.


Email me to give me a compliment, complaint, or correction. I'll respond.


  All of my books include free interactive online exercises that make the knowledge stick.

A Smarter Way to Learn JavaScript
Shop for it at Amazon
A Smarter Way to Learn HTML and CSS
Shop for it at Amazon
A Smarter Way to Learn jQuery
Shop for it at Amazon

copyright © 2017 by Mark Myers. All rights reserved.

0,1,2,3,4,5,6,7,8,9,10,11

0

0

0

0

What keyword tells Python to display something on the screen?print^ *print *$
Complete the line of code to tell Python to display the name of the oval object laid by a hen. (1 word, lower-case)print________("egg")^ *\(•egg•\) *$
Tell Python to display the letter "e". print("e")print`(`"`e`"`)
Tell Python to display the name of our planet. (1 word, lower-case)print("earth")print("earth")
Tell Python to display the name of the star that makes life possible on earth. (1 word, lower-case)print("sun")^ *print\(•sun•\) *$
In a print statement, the characters surrounded by quotation marks are a text _______.string^ *string *$
Tell Python to display the first three letters of the alphabet in upper-case.print("ABC")^ *print\(•ABC•\) *$
Tell Python to display a string of your choiceprint("whatever")^ *print\(•.+•\) *$
Tell Python to display your first name.print("Mark")^ *print\(•.+•\) *$
Tell Python to display the three-letter word for a canine. (1 word, lower-case)print("dog")^ *print\(•dog•\) *$
  1. Click in the left-hand Trinket panel.
  2. On line 1, write a statement telling Python to display the string "Hello, World!"
  3. Click the Run button   above your code. If you've coded correctly, the string will display in the right-hand panel. (You can click Instructions at the top of the right-hand panel to see the correct code.)
47bbbae759
  1. Click in the left-hand Trinket panel.
  2. On line 1, write a statement telling Python to display your first name.
  3. Click the Run button   above your code. If you've coded correctly, your name will display in the right-hand panel. (You can click Instructions at the top of the right-hand panel to see the correct code.)
d47b9f2e2a