Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4656741

Browse files
committed
Python 3: print -> print()
1 parent 3e43831 commit 4656741

7 files changed

+35
-35
lines changed

‎2009年01月01日-SienaTutorials/Worksheet05-CollatzConjecture.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Notice that this sequence has entered the loop `4 \mapsto 2 \mapsto 1
7474
x = 0
7575
while x < 7:
7676
x = x + 2
77-
print x
77+
print(x)
7878

7979
::
8080

‎2009年01月01日-SienaTutorials/Worksheet06-LinearAlgebra.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,13 @@ Matrices
160160

161161
for P in Permutations(4):
162162
L = list(P)
163-
print L
163+
print(L)
164164

165165
::
166166

167167
sage: for P in Permutations(4):
168168
....: L = list(P)
169-
....: print L
169+
....: print(L)
170170
[1, 2, 3, 4]
171171
[1, 2, 4, 3]
172172
[1, 3, 2, 4]

‎2011年01月27日-how-to-contribute.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ Now, you may use the following Mercurial commands to look at your local changes.
304304
sage: Permutation([2, 4, 1, 5, 3]).inverse()
305305
[3, 1, 5, 2, 4]
306306
"""
307-
+ print"YO !!!! Let's inverse some permutations !!!"
307+
+ print("YO !!!! Let's inverse some permutations !!!")
308308
w = range(len(self))
309309
for i,j in enumerate(self):
310310
w[j-1] = i+1
@@ -436,7 +436,7 @@ Here is an example of a patch exported by Mercurial for the imaginary ticket
436436
sage: Permutation([2, 4, 1, 5, 3]).inverse()
437437
[3, 1, 5, 2, 4]
438438
"""
439-
+ print"YO !!!! Let's inverse some permutations !!!"
439+
+ print("YO !!!! Let's inverse some permutations !!!")
440440
w = range(len(self))
441441
for i,j in enumerate(self):
442442
w[j-1] = i+1

‎demo-modelling-mathematics.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ exemple, les questions de factorisation::
9797
6*(x^2 - 2)*(3*x + 1)^2
9898

9999
sage: for K in [ZZ, QQ, ComplexField(16), QQ[sqrt(2)], GF(5)]:
100-
....: printK, ":"; printK['x'](p).factor()
100+
....: print(K, ":"); print(K['x'](p).factor())
101101
Integer Ring :
102102
2 * 3 * (3*x + 1)^2 * (x^2 - 2)
103103
Rational Field :

‎demo-monoids-character_rings.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Demonstration: Calculations with character rings of the biHecke monoid (experime
3131
sage: S0 = G0.S(); P0 = G0.P()
3232

3333
sage: for e in P0.basis():
34-
....: print"Ind(",e, ")=",P(G.induce_from_M0(S0(e))) # indirect doctest
34+
....: print("Ind(",e, ")=",P(G.induce_from_M0(S0(e)))) # indirect doctest
3535
Ind( P[1234] )= P[1234]
3636
Ind( P[2134] )= P[2134] + P[2314] + P[2341] + P[2413] + P[4213]
3737
Ind( P[2314] )= P[2314] + P[2341]

‎demo-monoids-characters.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,13 @@ Here are the composition factors of projective modules and left class
213213
modules::
214214

215215
sage: for chi in P.basis():
216-
....: print"%s = %s"%(chi, S(chi))
216+
....: print("%s = %s"%(chi, S(chi)))
217217
P[0] = S[0] + S[1]
218218
P[1] = S[1] + S[2]
219219
P[2] = S[2]
220220

221221
sage: for chi in T.basis():
222-
....: print"%s = %s"%(chi, S(chi))
222+
....: print("%s = %s"%(chi, S(chi)))
223223
T[0] = S[0]
224224
T[1] = S[0] + S[1]
225225
T[2] = S[1] + S[2]

‎demo-montrealpython-2010.rst

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -379,32 +379,32 @@ by Timothy Clemans and William Stein
379379
....: g = k.multiplicative_generator()
380380
....: a = ZZ.random_element(10, maxp)
381381
....: b = ZZ.random_element(10, maxp)
382-
....: print"""
383-
sage: <html>
384-
sage: <style>
385-
sage: .gamodp, .gbmodp {
386-
sage: color:#000;
387-
sage: padding:5px
388-
sage: }
389-
sage: .gamodp {
390-
sage: background:#846FD8
391-
sage: }
392-
sage: .gbmodp {
393-
sage: background:#FFFC73
394-
sage: }
395-
sage: .dhsame {
396-
sage: color:#000;
397-
sage: font-weight:bold
398-
sage: }
399-
sage: </style>
400-
sage: <h2 style="color:#000;font-family:Arial, Helvetica, sans-serif">%s-Bit Diffie-Hellman Key Exchange</h2>
401-
sage: <ol style="color:#000;font-family:Arial, Helvetica, sans-serif">
402-
sage: <li>Alice and Bob agree to use the prime number p = %s and base g = %s.</li>
403-
sage: <li>Alice chooses the secret integer a = %s, then sends Bob (<span >g<sup>a</sup> mod p</span>):<br/>%s<sup>%s</sup> mod %s = <span class="gamodp">%s</span>.</li>
404-
sage: <li>Bob chooses the secret integer b=%s, then sends Alice (<span class="gbmodp">g<sup>b</sup> mod p</span>):<br/>%s<sup>%s</sup> mod %s = <span class="gbmodp">%s</span>.</li>
405-
sage: <li>Alice computes (<span class="gbmodp">g<sup>b</sup> mod p</span>)<sup>a</sup> mod p:<br/>%s<sup>%s</sup> mod %s = <span class="dhsame">%s</span>.</li>
406-
sage: <li>Bob computes (<span class="gamodp">g<sup>a</sup> mod p</span>)<sup>b</sup> mod p:<br/>%s<sup>%s</sup> mod %s = <span class="dhsame">%s</span>.</li>
407-
sage: </ol></html>
382+
....: print("""
383+
....: <html>
384+
....: <style>
385+
....: .gamodp, .gbmodp {
386+
....: color:#000;
387+
....: padding:5px
388+
....: }
389+
....: .gamodp {
390+
....: background:#846FD8
391+
....: }
392+
....: .gbmodp {
393+
....: background:#FFFC73
394+
....: }
395+
....: .dhsame {
396+
....: color:#000;
397+
....: font-weight:bold
398+
....: }
399+
....: </style>
400+
....: <h2 style="color:#000;font-family:Arial, Helvetica, sans-serif">%s-Bit Diffie-Hellman Key Exchange</h2>
401+
....: <ol style="color:#000;font-family:Arial, Helvetica, sans-serif">
402+
....: <li>Alice and Bob agree to use the prime number p = %s and base g = %s.</li>
403+
....: <li>Alice chooses the secret integer a = %s, then sends Bob (<span class="gamodp">g<sup>a</sup> mod p</span>):<br/>%s<sup>%s</sup> mod %s = <span class="gamodp">%s</span>.</li>
404+
....: <li>Bob chooses the secret integer b=%s, then sends Alice (<span class="gbmodp">g<sup>b</sup> mod p</span>):<br/>%s<sup>%s</sup> mod %s = <span class="gbmodp">%s</span>.</li>
405+
....: <li>Alice computes (<span class="gbmodp">g<sup>b</sup> mod p</span>)<sup>a</sup> mod p:<br/>%s<sup>%s</sup> mod %s = <span class="dhsame">%s</span>.</li>
406+
....: <li>Bob computes (<span class="gamodp">g<sup>a</sup> mod p</span>)<sup>b</sup> mod p:<br/>%s<sup>%s</sup> mod %s = <span class="dhsame">%s</span>.</li>
407+
....: </ol></html>
408408
....: """ % (bits, p, g, a, g, a, p, (g^a), b, g, b, p, (g^b), (g^b), a, p,
409409
....: (g^ b)^a, g^a, b, p, (g^a)^b)
410410

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /