Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Basics Meet Python Syntax and Errors

What he difference between upper and lower case P? Why does it have to be upper or lower? I don't understand WHY exactly

What he difference between upper and lower case P? Why does it have to be upper or lower? I don't understand WHY exactly

6 Answers

Maxwell Newberry
Maxwell Newberry
7,693 Points

Python, like a lot of other languages (such as Java, C, C++, and more) are case-sensitive languages. Meaning writing out code with uppercase or lowercase letters matters.

Languages like SQL, Pascal, Fortran, and Basic are all case in-sensitive languages.

Damien Bart
Damien Bart
128 Points

The difference is that when you put Print it thinks that you want to use that variable but when you use print it knows you want to print the string.

lenielson sousa
lenielson sousa
2,739 Points

You can create variables uppercase or lower case, the convention is to use lower case for variables, except master passwords or something extremely important. For example:

some_text = "Hello World"
Some_text = "Hello World"
MASTER_KEY ="key@32532md%2dsgd#pass"

These are all variables, one different than the other. The case sensitive means that it matters if you call a variable (some_text or SOME_TEXT) the interpreter will not relate one to another.

To recap: variables - usually uses lowercase: var_info, name, pass_info etc...

important variables - MASTERKEY, ADMINLOGIN etc , upper case.. (although not recommenced )

lastly, classes usually capitalize the first letter as convention, eg: class Create_user.

marin stefan daniel
marin stefan daniel
5,422 Points

"print" is a built-in function . already defined with lower case . if u use capital P python does not recognize it as the built in function for printing and instead it thinks you want to to something on purpose ...like creating a new variable or call another function and it is not defined yet...the same is for all functions ...like len() or range() ....etc . they are already pre-defined...meaning someone already defined them as they are written...with lowercase.and unless you type exactly letter for letter ...python does not know you want to access that function ... it thinks you are trying to do something else.later when you'll learn to build your own functions for whatever you may need you'll see that you need to name them ,and some names are unavailable ...like print() ...because it is already in use.you can however build your own function called Print ...which may do whatever you want it to do ... and then you will see the difference

so print with big P like Print is a variabel but print with small p like print is not a variabel?

what is print? is it something that calls a function?

Sergio Andrés Herrera Velásquez
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Sergio Andrés Herrera Velásquez
Python Development Techdegree Graduate 13,177 Points

print with a lower case "p", is part of the syntax of the programming language, basically it is a native function and something that python understands it to perfom a task, while Print with a capital "P" is something new to python which it doesn't understand or something other than a function