Extra Variables

# This is an update on variables used in test4.py
# In here, we are going to use some variables in a form of letters
# To do some calculations
# As you know, you must equate your variable to something. It should ve a partner ๐Ÿ™‚

a = 4
j = 2
q = 1
i = 8

print “a + j” # This does not print out the required result ๐Ÿ˜ฆ ‘6’
print “i + q” # Instead, it prints out i + q
print “j + q” # It prints out the letters as they are on the screen ๐Ÿ˜ฆ
print “a + i” # That is not the target, let’s try something else,

print a + j # Ok, so this one works ๐Ÿ™‚
print i + q # When using 2 partnering variables raw, don’t add any quotes
print j + q # To it. If quotes are added, they wont be printed as a ‘variable’
print a + i # Defined earlier on but rather as they are on the screen
print a / q
print q * i
print a + q / i
print i / q – a

Have your say

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s