Handy Variables | CyberStart Completion

Handy Variables


Next, let’s take a look at something called variables, a really simple programming concept. It’s basically just a box with a label that can hold something, but a thing you’ll find very useful as you go on to write more advanced code.


You need to print the 4 variables described in the comments. Keep in mind, you only use quotation marks around Strings (text). Don’t use them for anything else!

Code Solution:

The following code is the solution to this challenge. Please note that there may be alternative ways to complete this challenge.

# CHALLENGE 1: First create a variable called aString and assign it
# the following text: Testing
# Remember the format to assign data to a variable
# ie: variableName = "SomeValue"
aString = "Testing"

# CHALLENGE 2: Next create a variable called anInt and assign it the
# following number: 899
# Remember, you don't need quotes for numbers!
anInt = 899

# CHALLENGE 3: Next create a variable called aFloat and assign it the
# following number: 12.55
aFloat = 12.55

# CHALLENGE 4: Next create a variable called aBool and assign it the
# value False.
aBool = False

# CHALLENGE 5: Print the variables out in order of the challenge
# number. i.e Challenge 1 first, then Challenge 2, and so on.