Introduction to Programming Python and C++

Author Archives: jsphsalazar

#BONUS

Here’s my video!

#Mastery11

If you want to call a function in Python you need to write the name of the function and its argument/s you want to use.
This is an example:

You will define your function with the arguments and then you will evaluate it adding the value of the argument…

#Mastery12

To create a function in Python, you need to write def followed by the name of the function, you can call your function as you want and finally between parentheses the argument of the function. If you want a function with one argument you will write something like this: If you want to use two […]

#Mastery4

Submitting work via Github is very easy, you just need your GitHub account (obviously) and then you will create a repository where you write your code and then submit it. Give a name to your repository, add a description if you want to, select if you want it to be private or public, and initialized […]

#Mastery17

This is very similar than the last one, but with the difference is that with elif we can evaluate more than 2 conditions For example: I’m using the same example but the elif is included.  

#Mastery16

You can use else statement when you have two conditions and the first one is false so the condition continues with the else until it gets true. Here’s an example: As you can see if z = 98, the first condition is not true, so the program will print the else statement.  

#Mastery22

On Python, there are three different ways of make a repetitive task: for statement: for loops are the best option when you want to repeat an action for a fixed amount of elements. while statement: The best moment for use a while loop is when you want a program to run a certain condition is […]

#Mastery26

A string is a sequence of characters. You can access the characters one at a time with the bracket operator. I’m going to declare a variable called team and I will use it for some examples. Len The function Len allows you to return the number of characters inside the string. The count starts with […]

#Mastery28

Python has the ability to receive input coming from the user. I’m talking about input function. When this function is called, the program stops and waits for the user to type something and the program continues when the user press return or enter. After the input() function, Python received the text from the user and […]

#Mastery29

You can do a lot of things with Python, one of them is validate the input of the user. Basically, you can compare the input from the user and the input you expect. Here’s an example: As you can see, at the end of the program it asks to the user if he/she want to […]

What should you work on?

Week #12 and more partial exams for you.

For this week's readings:
C++ (TC1017) should either be looking at support for your project, ImageMagick C++ libraries are a good start.
Python (TC1014) should be finishing chapter 11 (Dictionaries).