Published: Oct. 23, 2019 by lukemakin |  estimated reading time: 8 minutes
Welcome to this online course on Python dedicated for people who haven't programmed before and want to start their journey with probably the most friendly language there is - Python. I'll do my best for this course to be written in a normal language with minimum technical definitions. The structure of this course is split to 5 posts, every week I will release a new one. To the 5th part of this training I'll include an online test + certification (if you score at least 80% of correct answers the document will be automatically generated in PDF format to download. This is what you will receive:



Don't forget to subscribe or signup in order to get full access and to be informed about releases of new parts.

What are you going to learn? We will start very, very slow finishing on Object Oriented Programming. The entire Agenda (might me slightly modified):

DAY 1

  • First program: Hello world

  • Comments in python

  • Basic data types (int, float, string, boolean)

  • Concatenation & formating

  • Working with numbers 

  • Working with strings 

  • Collecting user input

  • Slicing


Day2:


  • Slicing part 2

  • Conditional statements

  • DS: Lists

  • DS: Dictionaries

  • DS: Sets

  • DS: Frozensets

  • Loops


DAY3


  • functions 

  • List comprehension

  • Args & Kwargs

  • Generators

  • Working with files

  • Modules


DAY 4


  • Lambda functions

  • List, filter, conditional list comprehension

  • Decorators

  • Error types

  • Error handling


DAY5


  • OOP

  • Magic Methods

  • OOP Project

  • Test

  • Certificate download


During the course you can use any text editor that supports Python (in this case you need to install Python at first), or you can code along in the consoles embedded to this posts.

So let's begin with our first program - in order to display something in the console we need to write - print() and put inside the brackets things we want to display. So let's check it out! Also I encourage you to play around in the console in order to get a proper understanding on how things work.

# write text inside ""
print("Hello World")

# create a variable to store the values
my_text = "Hello World"

# Put the variable inside without the quotation marks
print(my_text)

Try it yourself: Let's move quickly to discuss the comments. While writing our code, often there is a need to leave short description for future reference or other developers. We can define comments as single (that start with a hash), and multiline comments (begin and end with triple-quotes) - let's check it out:


'''
This
is
a
multi-line
comment

IN THIS COURSE I WILL USE MAINLY MULTILINE COMMENTS - THE REASON IS THAT MY TEXT EDITOR HIGHLIGHTS THEM BETTER THAN THE SINGLE LINE ONES
'''

# this is a single line comment
# another single line comment

The next step is to understand the basic python data types. In this lesson we won't discuss the ones, that you can iterate through, because this is something we will cover in part 2. For now what you need to know is that we can write numbers: integers (full numbers) & floats (numbers with decimal places). We also have strings that must be defined in quotation marks (just like we did printing out Hello World)




'''
Basic data types
'''

a = 5
b = 3.0
c = 'Hello World'
d = True

'''
Print out types of data according to the defined variables
in order to check the type of the variable use the type() function
'''

print(type(a))
print(type(b))
print(type(c))
print(type(d))

'''
Output:
<class 'int'>
<class 'float'>
<class 'str'>
<class 'bool'>
'''

''' concatenation:
putting together the data '''

name = "John"

introduction = "Hello" + " " + name
print(introduction)

'''
Output:
Hello John
" " - this is in order to put the space between Hello and John
'''

'''
Formatting if you want to display many data types - format all to string
There are few ways to do this, but we will use {} and format
Order of variables passed in the format matters
'''

age = 32
introduction2 = "Hello, I am {}. I'm {} old".format(name, age)
print(introduction2)

'''
Output:
Hello, I am John. I'm 32 old
'''

''' Now it's time for you to play in the console and test yourself. If you have any problems, just look at the example above or let us know in the comments:

The rest of the article is in the EXTRAS section for logged in users. Don't have a account? Create one now - it's FREE and I'll hope you’ll enjoy the section below (a lot of content over there)

 
Extras
To view additional content login or create a free account
Categories:
Share your thoughts

No comments yet...

Signup to the newsletter
To get the latest updates from pyplane
© copyright 2019 pyplane.com