numberOfObjects = 42;
a = []
for i in range(numberOfObjects):
# Recommended
print i
a.append(i)
numberOfObjects = 42;
a = []
for i in range(numberOfObjects):
# Recommended
a.append(i)
print "Enter value: ";
value = int(raw_input())
if value == 1 or value==2:
print "1 or 2: " , a[value]
else:
if (value > 2 and value < numberOfObjects):
print "Not 1 or 2: " , a[value]
class Status:
red = 1
green = 2
def convertStatus(status):
if status == Status.red:
return "Red"
elif status == Status.green:
return "Green"
else:
return "Illegal value"
print convertStatus(1)
print convertStatus(2)
print convertStatus(5)
m = 10;
errorflag = False;
for i in range(m):
if (True):
errorflag = True;
break; # leaves loop
# no goto needed
if(errorflag):
pass