Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
8421 Lượt xem

Hello Everyone,

I have try to get element of list using index . I have get first one element of list but how to get other element one by one or respectively .

My python code below :

     for search_val in stage_obj:
         status_list.append(search_val.id)
         status_list.sort()for ress in status_list:
         if ress:
             self.workflow_stages = ress
             length = len(status_list)
             for index, item in enumerate(status_list):
             if index < length:
                 next_index = index + 1
                 if index:
                 self.workflow_stages = index
              else:
                  break
         return True
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi Manish,

In your code, you should replace the break statement by continue statement.

break statement in your else condition breaking the whole loop and you are not able to get the next element from the list.

Sudhir Arya
ERP Harbor Consulting Services


skype:sudhir@erpharbor.com  website: http://www.erpharbor.com
Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 3 22
15991
0
thg 10 18
6372
1
thg 1 22
28738
1
thg 6 18
15220
1
thg 3 18
4069