In C/C++:
for(int i=0;i<=5;i++)
In Python:
for i in range(0,5)
Question is:
s=[1,2,3,4,1]
for i in s:
for j in s:
Here i wanna make second for loop j=1 (j value should be start with 1 like this s[1]=2).How do 开发者_Python百科i pass that value.
You should ask this on stackoverflow, but the answer is (if I got you right):
for i in s:
for j in s[1:]:
Read this chapter about lists in python, this will help you.
精彩评论