Skip to content

Instantly share code, notes, and snippets.

@IanMcT
Created September 26, 2016 18:46
Show Gist options
  • Save IanMcT/f36a52dd6024fb7516d8f27cbea405e1 to your computer and use it in GitHub Desktop.
Save IanMcT/f36a52dd6024fb7516d8f27cbea405e1 to your computer and use it in GitHub Desktop.
Demonstrates conversions
def output_variables():
print("w:", w, "Type:", type(w))
print("x:", x, "Type:", type(x))
print("y:", y, "Type:", type(y))
print("z:", z, "Type:", type(z))
w = 3.2
x = 3.8
y = -3.2
z = -3.8
output_variables()
w = int(w)
x = int(x)
y = int(y)
z = int(z)
output_variables()
w = float(w)
x = float(x)
y = float(y)
z = float(z)
output_variables()
w = str(w)
x = str(x)
y = str(y)
z = str(z)
output_variables()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment