0

I am looking for an alt-code that I can use to insert rho (ρ) into python.

I have tried Alt + 961 which returns ┴ which does not work. I can however copy a rho symbol from Word and paste into python which does work, but would be better to be able to directly insert it into python.

The reason for not wanting to explore the unicode options for the greek symbol ρ is because I like having my variables as greek letters when coding. I am fully aware that there are formatting options with the print() command to give the ρ symbol, however I would like ρ to be the subject of my equation. Or am I wrong and it can be done with unicode?

Any ideas?

Mat
  • 45
  • 7
  • You can use numpad to enter unicode by pressing `ALT` > `+` (on numeric keypad) > `03C1` for Windows. I cannot test because I do not have numpad :) `\u03C1 ρ GREEK SMALL LETTER RHO` – Razzle Shazl Mar 08 '21 at 09:57
  • I got that from the first google search result for: `how to print unicode rho` – Razzle Shazl Mar 08 '21 at 10:00
  • `I have tried Alt + 961` -- this way (without the `+` in my comment above) will give you an ASCII character (pre-unicode character set). – Razzle Shazl Mar 08 '21 at 10:03
  • Thank you. Didn't know unicodes could be used similarly as Alt codes from the keyboard like that. – Mat Mar 08 '21 at 12:18

1 Answers1

0
C1 =d.add(elm.Capacitor().label("C1 1 $\u03C1$F" ))#PICOFARAD
C1 =d.add(elm.Capacitor().label("C1 1 $\u00B5$F" ))#MICROFARAD
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
  • 3
    Welcome to Stack Overflow! While this code may solve the question, [including an explanation](//meta.stackexchange.com/q/114762) of how and why this solves the problem would really help to improve the quality of your post, and probably result in more up-votes. Remember that you are answering the question for readers in the future, not just the person asking now. Please [edit] your answer to add explanations and give an indication of what limitations and assumptions apply. – Yunnosch Feb 12 '22 at 11:01