What Is a Python Code Example?

What Is a Python Code Example?

Python is an easy to use and relatively new programming language that you can use to do many things. For example, you could make a sentence all lowercase using Python.

str1 = raw_input(Enter Sentence:)

str2 = str1.lower()

print str2

When you run this code, a box appears saying "Enter Sentence:". You then enter sentence. This occurs because the code "raw_input" in Python means that the user is going to give some information to the program. The sentence is then shown with no capital letters. This is because str1.lower() turns every capital letter into a lowercase one and calls that new sentence "tr2". "Print str2" prints the sentence to the screen.