Introduction to Python Programming Course - Part 1
Installing was pretty simple! All done and not much space required on the Mac. Not compared to Xcode!
Now I'm all set up with that, the next step is to find a good taster course - something simple and easy just to whet the whistle.
I've browsed few a few websites and some have the 'zero to hero' tagline, or words to that effect. In my experience, these are too all-promising and tail off in quality as there is no way that one course is enough to make you an expert! So I'm looking for something simpler...
OK this looks like a good option. Something I can do in a few weeks i.e. by the Christmas break:
Let's get stuck in!
Start Time: 18:06
Part 1 - Introduction
1 - Welcome
Python one of the most widely used etc.
2 - Programming in Python
Case sensitive; spacing - important
Errors - these aren't bad! Just the computer is telling you it doesn't understand
3 - Nanodegree Program
Advert for doing this study course
Part 2 - Data Types and Operators
1. Arithmetic Operators
First box - code editor; second - output box
2. Data Types and Operations
Same as swift - for the four operations
Paused at 18:15 - don't actually have Python installed properly... OK not that hard - I already had Python - just needed to add the program to use it with: IDLE
Continued at 18:20
Exponentiation operator: ** e.g. 4 ** 2 = 16
bitwise - another type of operator. On the notes...Looks quite complex, leaving that for now!
% - modulo. Returns the remainder (same as Swift)
// - integer division - divides one int by another then rounds down, even if .5 or higher
3. Quizzes
Electricity Bill - Basically an average for three totals, easy!
Calculate - this was trickier. A lot of numbers to put into the print screen, which I would rather avoid and set as separate variables first. But I don't know how to do that yet!
Correct expression - had a few goes at this. Not clear to me about the gaps, logic etc. So will need to practise more
4. Solutions
Just a repeat of the solutions for the above
5. Variables and Assignment Operators
Here we go!
OK. So assignment operator (=) is the same. No need for var or let.
So that's a key difference. Just straight in with defining the variable.
Variable names need to be descriptive. Only use ordinary letters, underscores or numbers. No spaces. No reserved words that have other purposes.
Underscores a key difference - no camelCase etc.
+= operator - I knew this was coming! Increment operator
-= and *= /= - all shorthand basically
6. Quizzes
Assign and modify variables - Lots of calculations here but got it! Did *= 0.9 for reducing by 10% and *= 1.05 for increasing by 5%.
Changing variable values - got this wrong but what I learned was the code is executed in ORDER. That means that as one of the variables had not been updated, it meant the original value remained.
This is a key difference to Swift - from what I remembered, that previous new variable would have then updated. Interesting - python is more logical but more repetitive in that way
Del - this is a keyword/reserved word - can't be used as a variable name!
Finish Time - 19:00
Total time - 49 minutes
A good first session! I learned about the basic operators - what I knew before but refreshed with things like the incremental, modulo, assignments etc. I learned about assigning NOT needing the var/let keyword, that each line has to be executed, variable naming conventions including underscore, and other things like exponentiation operator (**) and integer division
Comments
Post a Comment