Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Crash Course Chapter 7
#1
I attempting to complete python crash course. A concern is the understanding of the work. For instance in chapter 7,
parrot.py >>>message = input("Tell me something, and I will repeat it back to you: ")
>>>print(message)
What I receive in python is
Tell me something, and I will repeat it back to you
The crash course says I should receive
Tell me something, and I will repeat it back to you: Hello everyone!
Hello everyone!
If the book isn't telling me to do this, how did the executed portion (Hello Everyone!) take part?
Reply
#2
You are using the interpreter interactively.
put the two lines of code in a text file, save as parrot.py
now on command line, type:
python parrot.py
Reply
#3
(Feb-05-2018, 05:05 PM)Demini Wrote: >>>message = input("Tell me something, and I will repeat it back to you: ")

The input() to the right of the equal sign is the 'prompt' the user see's, 'message' to the left of the equal sign is the variable name that will hold the response to what the user enters at the prompt, in this case you should enter Hello Everyone! at the prompt, which is then saved in the variable 'message'. The line print(message) is saying print out the value held in variable 'message'.

>>> message = input("Tell me something, and I will repeat it back to you: ")
Tell me something, and I will repeat it back to you: Howdy parrot
>>> print(message)
Howdy parrot
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#4
Thanks
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python Crash Course ( 2nd edition) alok 1 2,625 Jul-19-2021, 05:55 PM
Last Post: snippsat
  Help in designing a timestamp finder for chapter-less TV shows Daring_T 1 2,470 Oct-26-2020, 09:30 PM
Last Post: Daring_T
  Im using python crash course version 2 james_newbie 3 3,085 Sep-07-2019, 09:21 PM
Last Post: ichabod801
  Python 3 crash course james_newbie 6 5,236 Aug-25-2019, 08:23 PM
Last Post: snippsat
  Pyinstaller exe won't launch after crash kainev 0 3,251 May-11-2019, 06:06 PM
Last Post: kainev
  Py_Initialize Crash with Python 3.6 paulhbm 0 5,083 Sep-20-2018, 09:56 AM
Last Post: paulhbm
  How to Crash a Computer keegan_010 6 5,645 Aug-05-2018, 06:01 AM
Last Post: Skaperen
  Console crash after boot. friendlymegalomaniac 1 3,251 Apr-07-2018, 05:44 PM
Last Post: wavic
  IDLE crash on Mac DamgAnd 12 13,355 Jan-03-2018, 12:26 PM
Last Post: srodway

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020