Python Crash Course: Learn Python in 2 Hours - Scripts for Marketers

July 07, 2022 | Admin |

Congratulations! It looks like you’ve decided to learn Python. You’ll be so happy with your decision to trust this Python crash course to make learning the new language easy.

Python is a fairly intuitive language, but there are some changes to those that are learning it for the first time. The good news, if this is your first language, is that it’s harder to switch from others than to start from scratch!

In this crash course, we’ll learn about Libraries, Formatting, If Statements, and For Loops for Python. Let’s get started!

Python Libraries are groups of code that better Python programmers have made to help you! They’re pretty amazing and can be added to your code really quickly.

You can quickly add advanced code into your project that would have taken you 3 months to write and impress your coworkers like you wrote it yourself.

Looking to scrape Twitter? There’s a library for that.

Looking to make heatmaps? There’s a library for that.

You get the point. You can call new libraries by typing the following code at the beginning of your script.

In your code, you can now use Pandas, a very famous data science library, in your program.

While most coding languages end with a semicolon at the end of every line of code, Python doesn’t. The end of each statement of code ends with no semicolon.

For new coders, this won’t phase you; however, if you are a seasoned coder, it can be upsetting.

You would write a print statement like this:

Another big distinction between Python and any other coding language is that Python doesn’t use brackets in its code. Instead, it uses whitespace to imply a relationship between a statement and the code inside of it.

By adding an indent, you can imply that code should be ran based on a condition or continuously many times.

As you test out code, remember that an indent can change your code a lot

If Statements check whether or not a statement is true and only continues if it is True.

Since the statement above is True, this will print “Kevin’s age is 22”. Since the statement above is True, the else statement will not run.

For loops are statements in Python that iterate across other statements multiple times until a condition is no longer True.

You can do things that would take you a lot of time over and over again based on different conditions.

The simple for loop

The while loop: continue until a condition is proved False number = 0 # instantiate the variable number as a zero # Continue the code inside the indent, while the number is less than 10 while number < 10: # print the number print(number) # increase the number by 1 number += 1 #

Warning!! # With this while loop, you need to be careful not to create an “Infinite Loop” # If you did not add the 1 to number, this would continue forever.

I’d recommend Codecademy and Datacamp if you’re looking for more in-depth Python crash courses.

If you feel ready to test some of these concepts in your own personal environment, here is how to setup Python on your own computer in 17 minutes.

Privacy Policy

Related Posts

Event Planning - Prince George's Community College - PGCC

Event Planning Career Development. The Event Planning Certificate program requires nine (9) sessions, which is broken down into two parts. The course will give you a blueprint on planning and executing special events with flair and without any unexpected surprises and expenses.

An event planner's primary goal is to provide consumers with valuable and comprehensive event planning information.

An event planner's primary goal is to provide consumers with valuable and comprehensive event planning information.

Event planners must be accomplished salespeople, know how to communicate with vendors, and have a working knowledge of catering, photography, lighting, tents, floral design, contracts and etiquette.

The course intention for event planners, owners...

Read more >>

TDLR Cosmetology 4hr Course - ACE Training Platforms

This TDLR Cosmetology 4hr Online course meets all TDLR requirements for Cosmetologists, Manicurists, and Estheticians to renew their license. This course covers Health, Safety, and …

$ 15.00 $ 10.00

TDLR Approved Renewal Course – Provider #540195 • TDLR Online Course #25622 • Instant Access – Online Course. • No Test or Quiz. • Study At Your Own Pace. Anytime. • On Any Device. Phone, Tablet, or Computer. • Hassle Free Navigation. Easy to Follow. • Certificate downloadable immediately upon completion.

— OR —

This TDLR Cosmetology 4hr Online course meets all TDLR requirements for Cosmetologists,...

Read more >>