How To: Challenge Yourself


Use what you learned

Write two lines of code below.

  1. Ask the user for his or her favorite number, and save the answer in a variable container called num.
  2. print out num doubled – that is, num * 2.

o, for example, if I tell you my favorite number is 3, you'll want to print out 6, and if I tell you my favorite number is 33, you'll want to print out 66.

Keep going for more tutorials (adapted, with permission, from Hour of Code, Trinket)