
This section contains the introduction to the instructor and the course, best practices to make most out of this course.
Best Practices:
Watch the video lectures
Then attempt the exercises
Take self evaluation quizzes
This is a very quick walk through the whole course. We list down what this course is all about, the main topics covered and what is cool in terms of syntax about Python.
Why to study python and how do we get started.
We will use idle as our IDE for this course. You can download python IDE from following link for Windows or Mac.
https://www.python.org/downloads/
Time to write you "Hello World" program in Python. Yes your first few lines of code.
The code will actually pull up a GUI saying Hello World :)
Introduction to the section. We are ready to start writing python shell commands.
This section is an introduction to your python shell. We will write a few commands and start getting used to how the shell behaves when you give commands. Entering literals can give you literals back and if you ask for some calculation, it is performed and the result is printed. We play with a few numbers and strings on the console here.
Handling data types in python as compared to C++, how to declare and use these numbers and string items in python shell. We also get started with some arithmetic operators in this section as well.
In this section we start working with variables in python. We will have another lecture related to variables later but we start working with them and using them now.
Please click on the star on top left (that's where it was last i checked) and rate the course. Your rating helps other students to decide whether to sign up for the course or not.
This lecture is all about operators. You'll to learn and use following operators
Addition
Subtraction
Multiplication
Division
Integer Division
Modulo (remainder)
Raised to power
Left shift
Right shift
And
Or
Xor
Not
Obviously this cannot be done without knowing a bit of binary numbers. We also talk about overflow and underflow as well if-any in python.
We continue our discussion for previous section, especially about shift operations, xor, not and eventually how to represent negative numbers in python. Yes we do talk about 2's complement in this section as well.
In this lecture we talk about how comparison operators work in python as compared to C++. We talk about following operators
Less than
Less than and equal to
Greater than
Greater than and equal to
Equal to
Not Equal
Not
In this section we start by discussing following logical keywords:
and
or
Also we talk about operator precedence, do some examples and exercise which operator will be calculated first in a statement or expression.
Rating the course is a good idea as it will help other students from Udemy community decide if they want to subscribe to this course or not. It'll take just a second, please rate the course if you haven't already.
We start making multi instruction programs in this section. This video introduces you to the content of this section.
This lecture teaches you how to write your first python file. The python files are saved with .py extensions and you can write multi-line code in python files. How to and where to write this code, how to save this as .py file, how to compile and how to run this course are the main things we discuss in this video.
We take a detailed dive into the world of variables in this video. We will talk about how variables are declared and used in C++ and how it is different to declare and use variables in Python. We also talk about the naming rules of variables and what are legal and illegal variable names.
This is a quick video talking about how to comment inside your .py files. Comments are pieces of text that you want the compiler to ignore while compiling your code. We also compare how comments work in C++ and how in contrast they work in Python.
We start by talking about assignment operator and how to assign different values to variables in this section. Then we learn how we use and exercise operator like
=
+=
*=
/=
%=
-=
and we learn how self assignment works.
We take input from keyboard and use the input in different programs. The data user enters using the keyboard is obviously received as text and then we use that text in different parts of our program.
Type casting is the process of converting one data type to another. So a variable of one data type is converted to another data type if the program requires you to do so. For example if you take a number input from the user, the default data type of input is text and the number is actually a set of digits in a string. You type cast it to an integer or float to make it usable for calculations in the program.
In this section we see how we do type casting.
In this section we see how if condition works in python and how it's syntax is different from other languages.
This section includes a few examples of Python if-else blocks and how it can be used to solve simple problems. For every example we also present same condition in C++ for easy learning.
No we add *else*, the otherwise section to the if condition to make full sense of your Python program. We do not use any curly brackets in any blocks hence in Python we will have if block and else block both without curly brackets.
When it comes to repeating code, loops are here for your rescue, but loops need to be used carefully with proper loop invariant to make sure the condition goes false and we eventually come out of the loop, otherwise the code will run for ever and the users will think the program got stuck. We will cover while loop and for loop in this section.
Time to work on while loop. With concentration on comparison between while loops in Python and C++, we will solve a few example problems and see how the programs work using loop. We also work on an approximate algorithm to calculate square root of a number using loops.
When you have a counter or a loop invariant in a loop that increments or decrements every time the loop runs, it is a good idea to use a for loop instead of a while loop. Syntax of for loop is slightly different in python but it still works the same way. Let's see how for loops work in Python.
Functions are reusable pieces of code, put into different modules, shared with other programmers, called from different programs, packed in different libraries and objects, passed different parameters and may or may not return a value. It happens in all programming languages, so it happens in Python as well. Let's check out how functions are coded in Python.
We learn here how to write functions in Python. How it is different from C++ functions. How to pass parameters, return numbers and how to call functions.
We build on top of our knowledge of writing functions in Python and go through a number of examples. Learning these examples will help you do the exercises at the end of this section as well.
This section tells you how you can use more than one code files in python. We will make a few functions, put them in another .py file and then use that py file by importing it into my main program. This is pretty much similar to using header files in C++ but instead of #include we use import here.
This import mechanism not only helps us organize the code, makes those files re-usable in my own code as well as allows me to share code with other programmers as well.
We do a full example of a simple importable .py file in this section. Don't miss this.
In this section we will learn how to make and use lists in python. Lists allow you to group a number of objects together for better handling and management of data and obviously to solve larger problems. These lists actually make the basis of some advance topics if you want to pursue them later for example data science, machine learning, even artificial intelligence. It all starts with the lists.
Lists in python are a set of objects tied together. You can make lists of integers, floats, boolean variables or other objects and even mixed data type as well. This section explains how to make simple numerical or string based lists, how to set variables, how to access them, print them and use them.
Something that we cannot do in C++ lists, we will be inserting elements right int he middle or at the end of the Python lists in this section. We will see how we can change a list to meet the requirement of our program by using built in functions for handling lists.
We can even arrange and sort lists, whether the lists are numerical or text based objects, the data is sorted both in ascending and descending order by using built in fictions. We can also grow, shrink, merge and divide existing lists into sub lists very easily in Python. Let's see how it is done in this lecture.
Lists of lists - aka - 2 dimensional lists are a very good tool to handle tabular data. Any data table with rows and columns can be considered a 2 dimensional list and data can be loaded in the memory using list-of-lists. We will discuss this in this lecture how to make these tabular 2 dimensional lists in Python, how to access these members, how to edit and update data, how to access full rows of data and so on.
In this section we will explore three more data structures, other than the lists. We will check out tuples, dictionaries and sets.
In addition to lists we will also learn about tuples, sets and dictionaries.
Tuples
Tuples are necessary read only lists, the lists in which we cannot edit objects, nor we can insert or append objects.
Dictionaries
Dictionaries are actually key value payers.
We have a list of data item and every data item has a name (or a key). To read or write to a value, you must tell which key you are righting. There's no limit on the size of the dictionary. Keys are unique but values can be duplicate.
Sets
This is just like our set theory sets as we learned in mathematics. The items of sets cannot be duplicate as it is against the definition of sets. We can apply set operations like union, intersection, difference etc with sets.
Whenever a program is done calculations on data, it is saved in a file. Saving data is an essential part of computer programs. In this section we will discuss how to create files, open files, write to files, read from files, delete files, edit files etc.
In this lecture we discuss how to open a file in python. How to open a file for reading, for writing and for editing. We start by writing a few basic messages in a text file using python code keeping an eye on the comparison with C++ code.
In this section we will go through a few examples related to files. We will write and read files line by line. We will try to read and write portions of files. We will edit files and we will also try to save a table of records separated by delimiters in a text file as well. This is a beginning of you writing your first database table to the file.
Time to go read, write and update a Microsoft Excel worksheet? Well yeah, we use a csv format to load, view, edit and update the data worksheets in python. A very interesting example to handle files.
The course is designed for C++ developers to quickly grasp Python syntax. We will learn Python syntax and a comparative study is done in each lecture comparing C++ and python syntax.
The course gives you a boost in learning python without going through clumsy documentation or lengthy books. The pace of the course is quick, so that you don't get bored with extra ordinary details but it is balanced with the depth of information that you are not left out on any topics.
You’ll get to learn the syntax of Python language in comparison to C++ and you’ll see how it is different and similar at the same time to work with data, variables, data types, files and lists. You’ll dive into the world of Python and it’s strong capability of type casting and data handling without worrying too much about the data types and memory allocations.
The course is meant for beginners who have probably never learned Python programming language but have a hint of C++ as their first or previously known language. People with no prior programming language can also take this course.
After completing this course, you can step forward to a more advanced course in python like Artificial Intelligence or Machine Learning.