Ask Your Question
0

print result

asked 2017-02-09 12:23:56 +0100

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

question:

@parallel
    ....: def f(a,b): return gcd(a,b)
    ....: for X, Y in sorted(list(f([(f1,phi1),(f1 ,phi2),(f1,phi3),(f1,phi4),(f1,phi6),(f1,phi8),(f1,phi12),(f1 ,phi24)]))): 
    ....:          i=range(1,8)
    ....:          print ((Y))
    ....:     
    1
    1
    z + 3
    z + 3*a + 4
    z + 2*a + 1
    z^2 + 2
    1

i want the above result in the following form after print command

z1=1
z2=1
z3=z + 3
z4=z + 3*a + 4
z5=z + 2*a + 1
z6=z^2 + 2
z7=1

please correct my code for the same

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-02-09 15:33:05 +0100

calc314 gravatar image

How about:

 print 'z'+str(i)+'=' +str((Y))
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-02-09 12:23:56 +0100

Seen: 94 times

Last updated: Feb 09 '17