Homework: Input & Output

Wrap Up In this lesson we covered the following topics: the input() function which also looked at how to convert data types again. the print() function in much more detail including how to use it for multiple strings and how to format the output. Homework Create the file howold.py in PythonAnwhere. Add this functionality to…

Read More

Output

You have now learned how to get information from the user – let’s talk about how to give feedback or information back to the user. The print() Function Yes, I know. You already know this one! But, we are going to look at it in a little more detail. The print() function displays information to…

Read More

Input

Many times you will need to get information from the user — their name, their age, their favorite summer time activity, their pet peeve…the list goes on.  One way you can do this in Python is via the input() function. The input() Function Allows the user to enter data from the keyboard. It waits for…

Read More

Homework: Numbers & Strings

Wrap Up In this lesson we have covered the following topics: How to do some math in Python using math operators. Lots of fun stuff about strings. Including: How to concatenate strings, tell how long they are and convert them to a string. Some of the basic String methods, like capitalize(), center(), count(), lower(), replace(),…

Read More

Homework

We will be using CodeAcademy in the beginning to do the first bits of homework.  Here’s how to use it: Go to codeacademy.com Login with username:  firstnamemscoding  (fionamscoding, katemscoding, calmscoding, tommscoding)  and password:  mscoding When you log on – you’ll see this screen: Click on the yellow Resume button and in the Python Syntax section…

Read More

Math Operations

What do you normally do with numbers? They definitely provide information but if you are manipulating and working with numbers at all, it is usually through math. Let’s look at how we do math with Python. In Python the standard math operators are: Operator Description Example + Addition 3 + 2 = 5 – Subtraction…

Read More

Data Types

Data Types are what kind of data you store in your variables, use in your comparisons and many other operations. These differ across programming languages. Python has seven main data types broken into various categories. Basic Data Types In Python, there are many types of data but only 3 that you use a ton. These…

Read More

Working with Strings

What is a String? Simply put – anything you can type from the keyboard! Strings are treated as text or a sequence of characters. Characters can include: Letters: a-z and A-Z Numbers: 0-9 Spaces Special characters like underscores, dashes, asterisks and more Only thing that is tricky? Single and double quotes. We’ll talk about that.…

Read More

Variables

A variable is used to store information so that you can use it again and again and again in your program.  You can think of a variable as simply a label to store a piece of information in. Creating a variable To create a variable you simply assign a value to the variable.  Here, we…

Read More