How can I use list defined outside, inside the function
Asked by
Trishala DAKA
Hi,
I tried using global in order to use the list defined inside the function,but yade shows error name " " is not defined.
>l = [1,2,3]
>def trail():
>...: global l
>...: e = len(l)
>...: trail()
ERROR SHOW IN YADE
/usr/bin/yade in <module>
2 global l
3 e = len(l)
----> 4 trail()
/usr/bin/yade in trail()
1 def trail():
2 global l
----> 3 e = len(l)
4 trail()
I also tried with saveVars I am getting the same error.
Can any one suggest the right way to use the list I defined inside a function.
Regards,
SaiDaka
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Trishala DAKA
- Solved:
- Last query:
- Last reply:
To post a message you must log in.