Hi,

I have to lists of numbers. I am trying to figure out a way to find
out where each number in both lists are identical.

Here is my coding, and I have a syntax error that I can't seem to
figure out.

Code:

p = list(str(n(pi, digits = 1000)))
d = list(str(n(e, digits = 1000)))
p.remove('.')
d.remove('.')
l1 = [int(x) for x in p]
l2 = [int(x) for x in d]
l3 = []
x = 0
for x in l1,l2: if l1[x:x+1]==l2[x:x+1]; l3.insert(x, (x,l1[x:x
+1],l2[x:x+1])); print l3

Error message:

------------------------------------------------------------
File "<ipython console>", line 1
for x in l1,l2: if l1[x:x+Integer(1)]==l2[x:x+Integer(1)];
l3.insert(x, (x,l1[x:x+Integer(1)],l2[x:x+Integer(1)])); print l3
^
SyntaxError: invalid syntax

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to