Ask Your Question
1

Greek variables

asked 2020-04-22 11:08:50 -0600

Cyrille gravatar image

Is it possible now that sagemath is under Python 3 to use greek letters as variables ? I remember this answer by tmonteil "it is not possible to use unicode λ in variables names, since Sage relies on Python 2, which does not allow it, so you have to wait the migration of Sage to Python 3 for that."

edit retag flag offensive close merge delete

Comments

Nicolas Thiéry started a discussion on this theme on sage-devel on 2020-02-21:

slelievre gravatar imageslelievre ( 2020-04-22 21:26:18 -0600 )edit

1 answer

Sort by » oldest newest most voted
2

answered 2020-04-22 11:26:29 -0600

dan_fulea gravatar image

Let's see...

sage: λ = 89                                                                                                                  
sage: print(λ)                                                                                                                
89
sage: print("λ is %s" % λ)                                                                                                    
λ is 89
sage: print("λ is {}".format(λ))                                                                                              
λ is 89
sage: print(f"λ is {λ}")                                                                                                      
λ is 89
sage: print("λ² + λ is {}".format(λ^2+λ))                                                                                     
λ² + λ is 8010

sage: probabilité = 1/3                                                                                                       
sage: q = 1 - probabilité                                                                                                     
sage: q                                                                                                                       
2/3

... ça marche...

edit flag offensive delete link more

Comments

Ok super and how do you have access to greek characters. Window 10 says [Windows key +.] but it doen't works

Cyrille gravatar imageCyrille ( 2020-04-22 12:25:43 -0600 )edit

Write

\phiTAB

(meaning press tab key)

FrédéricC gravatar imageFrédéricC ( 2020-04-22 14:31:52 -0600 )edit

FrédéricC Thanks but to be precise the cod must be \phi<tab>

Cyrille gravatar imageCyrille ( 2020-04-22 16:15:22 -0600 )edit

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: 2020-04-22 11:08:50 -0600

Seen: 116 times

Last updated: Apr 22