Python programming for C++ developers
- 6.5 hours on-demand video
- 7 articles
- 7 downloadable resources
- Full lifetime access
- Access on mobile and TV
- Certificate of Completion
Get your team access to 4,000+ top Udemy courses anytime, anywhere.Try Udemy for Business
- A quick introduction to python syntax. Variables, data handling, lists, functions, loops, conditions, input, output, file handling, recursion, exception handling, GUI programming and more.
This section contains the introduction to the instructor and the course, best practices to make most out of this course.
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.
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.
This lecture is all about operators. You'll to learn and use following operators
Raised to power
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.
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.
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.
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.
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.
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.
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 addition to lists we will also learn about tuples, sets and dictionaries.
Tuples are necessary read only lists, the lists in which we cannot edit objects, nor we can insert or append objects.
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.
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.
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.
- If not C++, preferably another similar syntax language like Java or C#
The course is designed for C++ developers to quickly grasp Python syntax. We will learn Python syntax and a comparitive 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.
- Programmers, those who know C++. This is not a beginner's course if you don't know programming already, may be this one is not for you.
- C++ experts looking to quickly grasp Python