Python - New concepts Cracked Flashcards
What’s the link between methods and functions
Write in procreate
”"”Methods are functions related to objects”””
What’s the difference between Functions and instances
Write on procreate
“Functions do specific things, whereas an instance of a class is a specific thing (a class is a real think , a person, or a car)”””
What are variables inside classes calls, and what two other sub parts of a class are there
Write in procreate
”"”Variables inside classes are attributes, arguements go into parameters which are inside classes”””
Please explain what an instance and an object and a class is…
Write in procreate
“A class is a framework through which we can create a real thing and assign properties and attributes to it (a person, a car etc). An object (sometimes known as an instance) is a specific instance of this class (in a car class, if we created a 1966 Honda, this would be an instance or object of this class)
What is the purpose of Self in python
Write in procreate
What’s the difference between a For and While Loop when it comes to iterating
Write in procreate
While loops iterate automatically, but do not increment automatically
What does a break do to a loop
Write in procreate
A break in a whole loop or for loop causes the iteration to end
What does the “in” mean a For or While loop mean
Write in procreate
””” ““in”” from the For or While Loop literally means ““inside of this variable we put…”” - then the list, dict, tuple to follow to put inside variable to be iterated”
What does continue do in a loop
Write out
“Continue in a loop is a little like stop and restart from the top. ““Means restart the loop from the top, iterating of course.”
What is a break in a loop
Write in procreate
A break condition means when satisfied means, that was fun, end the loop run.
What is a pass in a loop
Write in progress
“Pass in a loop means ““go on””, it’s a filler that doesn’t really change or obstruct the loop run, “
It’s a placeholder that avoids an error
What are the 5 error types in python
Write / draw in procreate
SRL - Syntax, Run-time, Logical Errors
Code this while loop on Juno or Desktop (USE YOUTUBE PHONE AS SECOND SCREEN)
https://youtu.be/cqqwxYLk8A0
Repeat this code using Juno or desktop (USE YOUTUBE PHONE AS SECOND SCREEN)
https://youtu.be/2JsGiygzi5M
Code in Juno or Desktop - USE YOUTUBE PHONE as second screen
Self innit function exercise
What do you do if you cannot grasp something?
GHBI (Google, Hasan, Brainscape + Image)
1 - Google for answer?
2 - Then message Hasan to check you know something well.
3 - Then create brainscape card
4 - with image on it to remember
How to become expert fundraiser
Pitch, pitch, pitch (like coding, expert level comes from time)
- create brainscape flash cards for perfect answer
Say what “init” method means in plain English
The “init” word means
“Now we are creating a new instance, these are the bits of information that make up the new instance”
init = “inside of this instance are attributes, X, Y, Z…and so on”
Is init automatically called by the Class name simply being written or does it needs to be specifically called, and init written when calling the instance?
No, init does not need to be specifically called, it is called automatically to setup a new instance of a class / object
What are some differences between a local and global variable
How to write code? 3 steps. SAB WiJ
- Screen shot CODE from YouTube Phone
- and add to brainscape card
- From this write out code in Juno - and save it so can reference it later