Hello World
You'll write one program that prints a single line, then change it, break it on purpose and fix it, which is the loop you'll repeat for as long as you code.
About
This is the program to start with. Pick one language and ignore the arguments about which one is best, because Python is a perfectly safe bet. The output isn't the point here. The point is the loop you'll repeat for the rest of your coding life: write something, run it, read the error, fix it, and run it again. Your first error will probably be a missing quote, or a file that quietly got saved as hello.py.txt. Copying a tutorial counts, as long as you type it and run it yourself.
At a glance
- Per requirement
- 15 XP
- Completion bonus
- 75 XP
- Requirements
- 6
- Takes
- One evening
- Skill level
- Novice (never tried it)
- Cost
- Free
- Supplies
- Nothing special
- Where
- At home
- Other people
- On your own
Requirements
-
1
Install one language and run its version command in a terminal. Python, JavaScript through Node, or Ruby are all good choices, so pick one and don't install three. Any machine works, whether that's a ten-year-old laptop, a library computer or a phone with a free terminal app. If the version number prints, the install worked, and checking that is the first thing to do whenever something goes wrong later. Take a screenshot of the terminal with the version number showing. Photo
-
2
Write a file that prints one line, and run it from the terminal. A plain text editor is enough for this. Save the file as hello.py or hello.js, then run it with python hello.py or node hello.js. A browser playground doesn't count here, because we want a file on your own disk, run by you. Take a screenshot of the file open in your editor next to the terminal showing its output. Photo
-
3
Break it on purpose, read the whole error, then fix it. Delete a closing quote or a bracket and run it again. Read the entire error message before you touch anything, and find the line number it points to. Most beginners never read past the first word, and the fix is usually sitting right there in the message. Take a screenshot of the error, then another of the working output. Photo
-
4
Make it ask for your name and greet you back. This is input, a variable and output, which are three ideas you'll use in every program from now on. Film a short clip of yourself typing your name and the program answering you by it. Video
-
5
Make it do some arithmetic you can check by hand. Your age in days or the minutes until Friday both work, and so does anything with a number you can check on paper. Watch out for integer division, because 7 divided by 2 is not always 3.5 in every language. Take a photo of the screen with your paper check beside it. Photo
-
6
Write five lines about what confused you most. Not what you learned, but what confused you, because that list is the syllabus for your next month. Keep it honest and keep it short. Take a photo of the handwritten note or a screenshot of the typed one. Photo