Let's talk Python!

·

2 min read

America's favorite Programming language

What is Python?

It was introduced to the world in 1991 and developed by Guido van Rossum. Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Python is appealing to most developers because of its easy-to-read syntax. Here are some beginner-friendly Python concepts:

#Reserved Keywords

#Indentifers

#Comments

#Indention

Reserved Keywords

FalseClassfinallyisreturn
Nonecontinueforlambdatry
Truedeffromnonlocalwhile
anddelglobalnotwith
aselififoryield
assertelseimportpass
breakexceptinraise

One important rule about reserved Words is when naming identifiers do not use any of the reserved words. Python uses the reserved words for its syntax and internal processing. There is also print() but it was removed and added as a built-in Python function.

Identifiers

An identifier is a name to give a variable, function, class, module or other object. When creating an identifier we are allowed to use uppercase, lowercase, numbers, and or the underscore character. Never start your identifier name with a number, do not use reserved words, and we cannot use special characters. Here are some Python-acceptable examples: example my_example, example_2, this_my_example. Here are some not acceptable examples: 1st_example, True_example!.

Comments

When creating a comment just insert # at the beginning and the entire will be commented out.

def comment(self):
    #This line is commented out. 
    print("This line is not commented out.")

Indention

In Java Script, we use { } to distinguish between code blocks. In Python we use : and indent when we are creating a new code block. When indenting the rule is to use 4 spaces each time when starting a new code block. Remember to use spaces and not tabs.

def indent(self):
#|||new_code_block
    print("Remember : and four spaces")

Conclusion

Hopefully, you see why Python is the apple of the eye of the Web Developer world. Python is easy to read, simple, and a good starting language for beginner developers.