Hello

Implement a program that prints out a simple greeting to the user, per the below.

$ python hello.py
What is your name?
David
hello, David

Specification

Write, in a file called hello.py in ~/pset6/hello, a program that prompts a user for their name, and then prints hello, so-and-so, where so-and-so is their provided name, exactly as you did in Problem Set 1, except that your program this time should be written in Python.

Usage

Your program should behave per the example below.

$ python hello.py
What is your name?
Emma
hello, Emma

Testing

While check50 is available for this problem, you’re encouraged to first test your code on your own for each of the following.

  • Run your program as python hello.py, and wait for a prompt for input. Type in David and press enter. Your program should output hello, David.
  • Run your program as python hello.py, and wait for a prompt for input. Type in Brian and press enter. Your program should output hello, Brian.

Execute the below to evaluate the correctness of your code using check50. But be sure to compile and test it yourself as well!

check50 cs50/problems/2020/fall/sentimental/hello

Execute the below to evaluate the style of your code using style50.

style50 hello.py

This problem will be graded only along the axes of correctness and style.

How to Submit

  1. Download your hello.py file by control-clicking or right-clicking on the file in CS50 IDE’s file browser and choosing Download.
  2. Go to CS50’s Gradescope page.
  3. Click “Problem Set 6: Sentimental (Hello)”.
  4. Drag and drop your hello.py file to the area that says “Drag & Drop”. Be sure it has the correct filename!
  5. Click “Upload”.

You should see a message that says “Problem Set 6: Sentimental (Hello) submitted successfully!” You won’t see a score just yet, but if you see the message then we’ve received your submission!