[Python] Proper nouns and snake case [closed]

Discussão em 'Python' iniciado por Stack, Maio 17, 2025.

  1. Stack

    Stack Membro Participativo

    When using the snake case variable naming convention, should proper nouns be capitalized?

    For example, suppose I were writing a Python program about the physical quantity called the Rabi frequency. Rabi frequency is named after Isidor Isaac Rabi and so Rabi is a proper noun and hence capitalized. PEP 8 suggests that Python variables should be in snake case, so which of the following snippets of code would be stylistically correct?

    Rabi_frequency = 0.1


    or

    rabi_frequency = 0.1

    Continue reading...

Compartilhe esta Página