Print a Greeting
FreePrint exactly <code>Hello, World!</code>
Show the solution
Text goes in quotes inside print(): print("Hello, World!")
Right — print() sends text to the output. Every Python program you write will use it.
Practice by topic / Python & code / Python
Python is the most popular language for automating work: cleaning data, renaming files, crunching numbers. Each exercise runs your real code in the browser and checks it. These 5 exercises build up step by step, starting with print a greeting, store a value, add gst.
3 of 5 free · no sign-up needed · instant feedback
Print exactly <code>Hello, World!</code>
Text goes in quotes inside print(): print("Hello, World!")
Right — print() sends text to the output. Every Python program you write will use it.
Create a variable called <code>company</code> holding the text <code>Acme Pte Ltd</code>, and a variable called <code>employees</code> holding the number <code>42</code>.
company = "Acme Pte Ltd" on one line, employees = 42 on the next.
Good — text needs quotes, numbers don't. Mixing those up is one of the most common Python bugs.
A price before tax is stored in <code>price</code>. Create <code>total</code>: the price plus 9% GST.
Multiply by 1.09: total = price * 1.09
Exactly — price * 1.09 works for any price, which is the whole point of a formula.
Using <code>name</code> and <code>amount</code>, print <code>Invoice for Mei: $120</code> — built from the variables, not typed out.
Solution and instant grading: open it in the practice app (use one of your 20 free picks, or Pro).
Try it in the live editor →A bill of <code>total</code> is split between <code>people</code>. Create <code>each</code> (the share per person, rounded to 2 decimal places).
Solution and instant grading: open it in the practice app (use one of your 20 free picks, or Pro).
Try it in the live editor →