I know this is simple, but I just can not understand how if and else statement works inside a for loop. This is the code I`m trying:
count = IN[0]
value = IN[1]
out = []
for i in range (count):
if i==7:
out.insert(i,'report')
else:
out.insert(i,value)
OUT = out
I`m getting the error message: "expected an indented block"
Basically, I need:
- To create a list of size 'count';
- Add 'value' on every index, but on index 7 I need it to be string 'report'
Aucun commentaire:
Enregistrer un commentaire