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
  Catching a crash within a library code ebolisa 9 3,169 Nov-22-2021, 11:02 AM
Last Post: bowlofred
  Python Crash Course ( 2nd edition) alok 1 1,882 Jul-19-2021, 05:55 PM
Last Post: snippsat
  Help in designing a timestamp finder for chapter-less TV shows Daring_T 1 1,856 Oct-26-2020, 09:30 PM
Last Post: Daring_T
  Im using python crash course version 2 james_newbie 3 2,398 Sep-07-2019, 09:21 PM
Last Post: ichabod801
  Python 3 crash course james_newbie 6 3,924 Aug-25-2019, 08:23 PM
Last Post: snippsat
  Pyinstaller exe won't launch after crash kainev 0 2,616 May-11-2019, 06:06 PM
Last Post: kainev
  Py_Initialize Crash with Python 3.6 paulhbm 0 4,388 Sep-20-2018, 09:56 AM
Last Post: paulhbm
  IDLE crash using special characters? reikonaga 6 4,750 Aug-06-2018, 07:37 AM
Last Post: keegan_010
  How to Crash a Computer keegan_010 6 4,259 Aug-05-2018, 06:01 AM
Last Post: Skaperen
  Console crash after boot. friendlymegalomaniac 1 2,582 Apr-07-2018, 05:44 PM
Last Post: wavic

Forum Jump:

User Panel Messages

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