AI on the Web

Expressions, Statements, and Functions


  • Expressions
    1 + 2 * 5
    [1, 2, 3]
    'A string'
    "first string" + " second string"
  • Statements:
    print "Hello World!"
    x = 2 + 2
    if x>3:
       print "x is greater than 3"
    else:
       print "x is not greater than 3"
  • Functions
    def square(x):
        return x*x