In a modify task you take code that already works and adapt it so that it
does something else. The editor starts you off with a program that asks whether
the user likes programming, but there is something odd about the conversation:
the name in it is fixed. The program calls everybody Billy, no matter who is
using it.
Adapt the code so that it holds a real conversation:
name = "Billy" with a print that asks the question below, followed
by an input() on the next line that collects the answer.Ask the question with its own print, exactly as written:
What's your name?
The line ends with the question mark: there is no space after it, and the user types the name on the next line.
Ask for the name first and for the answer second. Leave the
Do you like programming ... ? question exactly as the starter code already
prints it: it is asked with its own print, followed by a bare input() on
the next line, which is the same pattern you are asked to add above it.
The lines your program prints must be exactly these, with Billy and yes
replaced by whatever the user typed. The questions are part of the checked
output, so spelling, capital letters and punctuation count:
What's your name?
We want to know if you like programming!
Do you like programming Billy?
Great, Billy! You said yes!
Let's learn some Python today...
Keep the empty line: it comes from the print() that is already in the starter
code, and it belongs between We want to know if you like programming! and
Do you like programming ... ?.
Input:
Billy
yes
Output:
What's your name?
We want to know if you like programming!
Do you like programming Billy?
Great, Billy! You said yes!
Let's learn some Python today...
Input:
Aisha
I love it
Output:
What's your name?
We want to know if you like programming!
Do you like programming Aisha?
Great, Aisha! You said I love it!
Let's learn some Python today...
Make sure that you check for the following things:
print does not have a capital letter.input command.+ between each string and variable that needs concatenating.