Skip to content

camel case

Camel case is a naming convention where you write a multi-word identifier without spaces, and use capitalization to mark word boundaries. The term is used broadly, but it’s often helpful to distinguish the two common variants:

  • lowerCamelCase: First word lowercased
  • UpperCamelCase: First word uppercased, commonly called Pascal case

Type a few words below to see how the same name looks in Pascal case (UpperCamelCase), camel case (lowerCamelCase), and snake_case:

Interactive diagram — enable JavaScript to view.

Python’s style guide, PEP 8, recommends snake_case for function names, variable names, method names, and instance attributes. It also recommends UpperCamelCase for class names.

Example

Here’s a quick example illustrating camel case usage:

Language: Python
>>> class ClassName:  # Camel case for class name
...     def method_name(self):
...         greeting = "Hello, World!"
...         print(greeting)
...

>>> obj = ClassName()
>>> obj.method_name()
Hello, World!

In this example, ClassName follows camel case conventions.

How to Write Beautiful Python Code With PEP 8

Tutorial

How to Write Beautiful Python Code With PEP 8

Learn how to write readable, high-quality Python code by following the PEP 8 style guide and using linters and autoformatters to enforce it.

intermediate best-practices

For additional information on related topics, take a look at the following resources:

Have a question about this? Mentor AI can show you examples, compare related terms, and point you to tutorials.


By Leodanis Pozo Ramos • Updated Nov. 16, 2026 • Reviewed by Dan Bader