Unit: Unit 1: Fundamentals of Python • Interactive Practice
Interactive Python programming tutorial and practice in your browser.
# Type checking and explicit casting
raw_input = "45"
numeric_val = int(raw_input)
tax_rate = 0.08
total = numeric_val * (1 + tax_rate)
print("Type of raw_input:", type(raw_input).__name__)
print("Type of numeric_val:", type(numeric_val).__name__)
print("Total:", round(total, 2))