Created
September 26, 2016 18:46
-
-
Save IanMcT/f36a52dd6024fb7516d8f27cbea405e1 to your computer and use it in GitHub Desktop.
Demonstrates conversions
This file contains 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
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