Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

List in Pyton

Status
Not open for further replies.

TSI06

Mechanical
Mar 16, 2011
2
Hi Everybody,

I want to make a List in Pyton script, for make few datum plans in abaqus.

I tried to make this lop:

i=0
Mylist= {}

while 0<= i <=10:
Mylist['i']=i
i=i+1

This loop is not good.

I would like to use the methods update, but i don't know what is the syntax for add a new number in a list.

For a Loop more simple

i=0
while 0<= i <=10:
i=i+1

Abaqus send me a strange Warning message :
Indentation error: ('expected an indented block',(C:/Temp/Copie de Copie de ISOthin3phase14.py', 167, 1, 'i=i+1\n'))

I don't understand what is the problem

Thank you












 
Replies continue below

Recommended for you

You nede to indent the i=i+1. Python uses indentation to determine what lines are in a loop.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor