#!/usr/bin/python3 # -*- coding: utf-8 -*- x = 4 print(type(x)) print(id(x)) print(x) y = 4.0 print(type(y)) print(id(y)) print(y) # If I type 7, what is the type of z??? z: str = input() print(type(z)) print(id(z)) print(z) # Type-hint comment, optional for now, but recommended # Explicit is better than implicit!! a: int = 4 b: float = 4.0 # Assignment statements # An assignment statement assigns a variable with the value of an expression. # [var] = [arithexpr] # Left must be a variable, right an arithmetic expression. # Below, the third statement assigns a with 2 times a's current value. # If a was 4, the statement assigns a with 2 * 4, or 8. print(a) # variables can be re-assigned to themselves a = 2 * a # variables can be re-assigned to other values b = (4 + 3) / 2 print(b)