Created
August 21, 2019 01:03
-
-
Save harrisonmalone/8b68d445e285c0f9ea2bed876ba7d7b8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 1. Make two variables called name and age. Assign them values, e.g. name = "bob" age = 20. Use string interpolation to print "My name is Bob and I am 20 years old". | |
| # string | |
| name = "Bob" | |
| # integer | |
| age = 20 | |
| p "My name is #{name} and I am #{age} years old" | |
| # 1. p | |
| # 2. puts | |
| # 3. print | |
| # 2. Here are two variables: x = 2, y = 3; Use string interpolation to print to screen: "The result of adding x to y is 5". | |
| x = 2 | |
| y = 3 | |
| p "The result of adding x to y is #{x + y}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment