G12_C12_ForTeacher
Text
Activity Flow | Slide No. | Topic | Time |
---|---|---|---|
3-7 | Revision + Quiz | 2 mins | |
8-18 | Introduction to Lists |
12 mins | |
TA | 19-23 | TA-Coding | 10 mins |
SA | 24-29 | Student Activity | 10 mins |
Wrap-Up | 30-32 | Wrap-Up Quiz | 2 mins |
SAA | 33-34 | Additional Activities | 10 mins |
Slide No. | Topic |
---|---|
13 | Lists in python |
20-23 | TA Coding Steps |
36 | Activity Links Table |
self is passed to each method of the class. And self can be used to access the class variables.
class book:
price=10
author="xyz"
def showPrice(self):
print( price);
Class name must be in same case as it is defined
book1 = Book()
book1 = Book()
book=book()
class Book:
price=10
author="xyz"
def showPrice(self):
print(self.price);
Book= book(self)
Change with earlier class image
Annie: Delhi
Sam : Noida
Jack : Gurgram
John : Gurgram
Customer can choose some properties of car like color, engine etc.
How cars are different when same blueprint is used?
Annie: Delhi
Sam : Noida
Jack : Gurgram
John : Gurgram
Color: Red
Engine: Petrol
Music yes
Annie: Delhi
Sam : Noida
Jack : Gurgram
John : Gurgram
p3 = Platform(80,150)
p1 = Platform(100,100)
p2 = Platform(120,80)
Annie: Delhi
Sam : Noida
Jack : Gurgram
John : Gurgram
pipe1 = Pipe(100)
pipe2 = Pipe(300)
Annie: Delhi
Sam : Noida
Jack : Gurgram
John : Gurgram
pipe1 = Pipe(100)
class Pipe:
var xposition
def __init__(self,x):
xposition=x
Annie: Delhi
Sam : Noida
Jack : Gurgram
John : Gurgram
Change with earlier class image
I have left with one name plate only
John and Sameer are coming can you mark their seats.
How can I use one nameplate to guide both
No problem I will ask John to sit on left side of name plate seat and Sammer on the right side.
Show john and sameer coming and sitting on left and right side of the seat with name plate
Reserve Seat
Annie: Delhi
Sam : Noida
Jack : Gurgram
John : Gurgram
Gap
BottomPipe.y= gap+100
topPipe.y= gap-400
100
BottomPipe.y= gap+100
400
Step 1: Create a Pipe class
Step 2: Create a constructor using __init__() method.
Step 3: Create a variable gap and assign random value to it.
Step 4: Create a rect named topPipe in the Pipe class.
Step 4: Create pipe1 object
Step 4: Add the display function and call it to display the pipes.
Oputput:
Task: Add the bottom pipe
Hint:
1. Create a rect "bottomPipe" in constructor function.
Note: Make sure bottom pipe is displayed below the gap.
2. Display the pipe image on bottompipe in display() function
Task: Add another set of pipes
Hint:
1. Create another Pipe class object
2. Display the pipe2 object using display function
In python constructor function us named as __init__
ball = Ball(20) is valid as this class's constructor takes one argument.
Which can be passed while creating the object.
ball= Ball()
ball(20)
ball = Ball(20)
Ball(20)
ball = Ball(20)
class Ball:
def __init__(self,x):
self.radius=x
Hint:
1. Create another Pipe class object
2. Display the pipe2 object using display function
Hint: 1. Load the cloud image in the images dictionary
2. Place the cloud image on the screen
Hint:
1. Increment the bee's x location to move it forward in gravity() function
Hint: 1. Load the cloud image in the images dictionary
2. Place the cloud image on the screen
Activity No. | Activity Name | Links |
---|---|---|
Teacher Activity 1 | Bee 3 |
|
Teacher Activity 2 | Bee 4 -SA solution | |
Teacher Activity3 | AA1- Solution | |
Teacher Activity4 | AA2 Solution | |
Student Activity 1 | Bee 3.5 | |
Additional Activity 1 | Bee 3.5 | |
Additional Activity 2 | Bee 3.5 |