Check50 cs50/problems 2022 python indoor
Indoor VoiceWRITING IN ALL CAPS IS LIKE YELLING. Show Best to use your “indoor voice” sometimes, writing entirely in lowercase. In a file called
Before You BeginExecute Next execute to make a folder called Then execute to change directories into that folder. You should now see your terminal prompt as to make a file called DemoHow to TestHere’s how to test your code manually. At the
If you run into an error saying your file cannot be opened, retrace your steps to be sure that you are inside your You can execute the below to check your code using
Green smilies mean your program has passed a test! Red frownies will indicate your program output something
unexpected. Visit the URL that How to SubmitIn your terminal, execute the below to submit your work. Getting StartedRecall that Visual Studio Code (aka VS Code) is a popular “integrated development environment” (IDE) via which you can write code. So that you don’t have to download, install, and configure your own copy of VS Code, we’ll use a cloud-based version instead that has everything you’ll need pre-installed. Log into code.cs50.io using your GitHub account. Once your “codespace” loads, you should see that, by default, VS Code is divided into three regions. Toward the top of VS Code is your “text editor”, where you’ll write all of your programs. Toward the bottom of is a “terminal window”, a command-line interface (CLI) that allows you to explore your codespace’s files and directories (aka folders), compile code, and run programs. And on the left is your file “explorer,” a graphical user interface (GUI) via which you can also explore your codespace’s files and directories. Start
by clicking inside your terminal window, then execute Click inside of that terminal window and then type followed by Enter in order to make a directory called Here on out, to execute (i.e., run) a command means to type it into a terminal window and then hit Enter. Commands are “case-sensitive,” so be sure not to type in uppercase when you mean lowercase or vice versa. Now execute to move yourself into (i.e., open) that directory. Your prompt should now resemble the below. If not, retrace your steps and see if you can determine where you went wrong! Shall we have you write your first program? Execute to create a new file called Proceed to write your first program by typing precisely these lines into
Notice how VS Code adds “syntax highlighting” (i.e., color) as you type, though VS Code’s choice of colors might differ from this problem set’s. Those colors aren’t actually saved inside of the file itself; they’re just added by VS Code to make certain syntax stand out. Had you not
saved the file as Listing FilesNext, in your terminal window, immediately to the right of the prompt ( You should see just Compiling ProgramsNow, before we can execute the And then execute this one again: This time, you should see not only
Now execute the program itself by executing the below. Hello, world, indeed! Getting User InputSuffice it to say, no matter how you compile or execute this program, it only ever prints Modify this program in such a way that it first prompts the user for their
name and then prints As before, be sure to compile your program with: And be sure to execute your program, testing it a few times with different inputs, with: WalkthroughHere’s a “walkthrough” (i.e., tour) of this problem, if you’d like a verbal overview of what to do too! HintsDon’t recall how to prompt the user for their name?Recall that you can use
Don’t recall how to format a string?Don’t recall how to join (i.e., concatenate) the user’s name with a greeting? Recall that you can use
Use of undeclared identifier?Seeing the below, perhaps atop other errors?
Recall that, to
use How to Test Your CodeExecute the below to evaluate the correctness of your code using
Execute the below to evaluate the style of
your code using How to SubmitIn your terminal, execute the below to submit your work. |