Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to add the customer's name to the invoice.
No-Code
invoice.customerName = [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using numbers or boolean values instead of a string.
Forgetting to put quotes around the name.
✗ Incorrect
The customer's name should be a text string, so we use quotes around the name.
2fill in blank
mediumComplete the code to set the invoice total amount.
No-Code
invoice.totalAmount = [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using text instead of a number for the amount.
Including currency words inside quotes.
✗ Incorrect
The total amount should be a number, not text, so use 100.00 without quotes.
3fill in blank
hardFix the error in setting the invoice date.
No-Code
invoice.date = [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using date formats that are ambiguous or not standard.
Not putting the date inside quotes.
✗ Incorrect
The date should be in a standard string format like "YYYY-MM-DD" for consistency and parsing.
4fill in blank
hardFill both blanks to create a dictionary entry for an item with its price.
No-Code
invoice.items = {"[1]": [2] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using quantity as a key instead of item name.
Putting numbers inside quotes.
✗ Incorrect
The key should be the item name as a string, and the value should be the price as a number.
5fill in blank
hardFill all three blanks to create an invoice summary with customer, total, and paid status.
No-Code
summary = {"customer": [1], "total": [2], "paid": [3] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using numbers for customer names.
Putting numbers or booleans inside quotes.
Mixing up true and false values.
✗ Incorrect
The customer is a string, total is a number, and paid is a boolean value.