You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
738 B
40 lines
738 B
1 2 3
|
|
|
|
def fun5():
|
|
c = 6
|
|
def fun6():
|
|
print("Hello")
|
|
c = 4 + 5 # Indentation error
|
|
|
|
# Global statements in between definitions
|
|
# (not allowed in the language manual)
|
|
if True:
|
|
if True:
|
|
print("Hello")
|
|
if True:
|
|
print("Maybe")
|
|
else:
|
|
print("World")
|
|
else:
|
|
print("Again")
|
|
else:
|
|
print("And Again") # Unmatched Else
|
|
|
|
class Thor(object):
|
|
y:int = 0
|
|
print("Right place?") # Statement in class
|
|
|
|
class Stones(object):
|
|
y:int = 0
|
|
def fun(x:int):
|
|
print("Right place?")
|
|
def bar():
|
|
return 2+3
|
|
print("Wrong Place")
|
|
|
|
# Functions without `statements'
|
|
# (not allowed in the language manual)
|
|
def fun1():
|
|
def fun2():
|
|
print("Hello")
|