print("Hi, my name is Cody!")This code prints the message Hi, my name is Cody! in the console. It doesn’t do much other than that. Be sure to add the text you want to be printed between
". Are you ready to revolutionize the tech industry?
elsepart of the statement is executed only when the
ifpart is not considered to be true.
if a == b:
print("The numbers are equal")
print("The numbers are different")
2to the variable
a = 2, and now any time you need to access the number
2, you can use the variable
ainstead. There are very pracitcal uses for this that we will go into further as we learn more about programming.
=, but it has a specific use in Python. The equals sign is used for assigning a value to a variable. For example,
n = 3. However, two equals signs do not perform the same action. Two equals signs are used for comparison. For example, to determine if variable
tis equal to
10, you would write
t == 10.
We'd love to hear your feedback!