project: Coding aptitude assessment challenge: Task 2

Tags skill/problem_solving
Hard Prerequisites
IMPORTANT: Please review these prerequisites, they include important information that will help you with this content.
  • CODING_APTITUDE_ASSESSMENT: Introduction to coding challenges
  • CODING_APTITUDE_ASSESSMENT: IMPORTANT!! Naming your files and functions
  • This task is very similar to task 1.

    Write a function that takes in a single optional parameter. It should work like this:

    • task2("Sally") should print Hello Sally!. Note that we are passing in a single string
    • task2("Tshepo") should print Hello Tshepo!
    • task2() should print Hello Friend!. Note that we are passing in no arguments here.

    Check your understanding!

    • How do function arguments/parameters work?
    • What happens if you pass in too many arguments?
    • How do you make an argument optional?
    • How do you join multiple strings together?
    • Did you use an if statement here? How was it used?
    • If you used an if statement, what happens if you don’t fill in the else part?
    • when are multiple strings considered equal? Would this be true or false: "Hello Sally" == "Hello, Sally" (try it yourself to see).

    RAW CONTENT URL