Home | Lecture 0 | Problem 0.1 | Problem 0.2 | Problem 0.3 | Problem 0.4 | Problem 0.5
WRITING IN ALL CAPS IS LIKE YELLING.
Best to use your “indoor voice” sometimes, writing entirely in lowercase.
In a file called indoor.py, implement a program in Python that prompts the user for input and then outputs that same input in lowercase. Punctuation and whitespace should be outputted unchanged. You’re welcome, but not required, to prompt the user explicitly, as by passing a str of your own as an argument to input.
- Recall that input returns a str, per https://docs.python.org/3/library/functions.html#input.
- Recall that a str comes with quite a few methods, per https://docs.python.org/3/library/stdtypes.html#string-methods.
From the root of your repository execute cd 0-FunctionsVariables So your current working directory is ...
/0-FunctionsVariables $:Next execute
`mkdir indoor`to make a folder called indoor in your codespace.
Then execute
`cd indoor`to change directories into that folder. You should now see your terminal prompt as /0-FunctionsVariables/indoor $. You can now execute
`code indoor.py`to make a file called indoor.py where you’ll write your program.
Here’s how to test your code manually. At the indoor/ $ prompt in your terminal: :
-
Run your program with
python indoor.py. TypeHELLOand press Enter. Your program should output:hello
-
Run your program with
python indoor.py. TypeTHIS IS CS50and press Enter. Your program should output:this is cs50
-
Run your program with
python indoor.py. Type50and press Enter. Your program should output:50
At the /0-FunctionsVariables/indoor $ prompt in your terminal:
git add -A Add all changed files in the repository to be committed
git commit -m “Upload completed indoor.py“Commit all files that have been added in the REPO with the comment “Upload completed indoor.py“
note: If the file is not complete, adjust the comment to describes what is being commited
git pushPush all changes to the REPO