Lesson04

Run Settings
LanguagePython
Language Version
Run Command
def a(): y = 2 return y + y x = a() print(x) x = a() + a() print(x) def b(): y = 2 return True x = b() print(x) print(b()+b()) #print(b + b) def a(): y = 1 def b(): print("I am from function b") #return None <-- hide return b x = a() print(x()) #print(None) x() = b(), after running b(), return None def a(): y = 1 def b(): print("I am from function b") #return None <-- hide return b() x = a() print(x) def a(): y = [1,2,3] z = 1,2,3 def b(): print("I am from function b") return None return y,z,b x = a() print(x[2](), id(x)) #x[2]() == b() function def a(w): y = w z = 1,2,3 def b(): print("I am from function b") return None return y,z,b x = a([1,2,3]) print(x[0], id(x)) def a(w): y = w z = 1,2,3 def b(): print("I am from function b") return None return y,z,b x = a(True) print(x[0], id(x)) def a(w): y = w z = 1,2,3 def b(): print("I am from function b") return None return y + y x = a('k') print(x, id(x)) def a(w): return w() def b(): print("I am fron function b") a(b)
Editor Settings
Theme
Key bindings
Full width
Lines