The battlefield:
Creation of the basic screen
G11-C3
Activity flow | Slide No | Topic | Time |
---|---|---|---|
TA | 4 | Quiz | 3 min |
5 | Revision | 3 min | |
6 | Screen creation | 3 min | |
7 | If statement introduction | 2 min | |
SA | 8 | If statement coding | 3 min |
TA | 9 | If-else introduction | 2 min |
SA | 10 | If-else coding | 3 min |
TA | 11 | Nested if introduction | 2 min |
SA | 12 | Nested if coding | 3 min |
TA | 13 | If elif introduction | 2 min |
SA | 14 | If elif coding | 3 min |
TA | 15 | While loop introduction | 2 min |
SA | 16 | While loop coding | 3 min |
SAA1 | 17 | Calculator creation | |
SAA2 | 18 | Table of 15 |
In class quiz
A:print(pygame)
B:import(pygame)
Which of the following statement is incorrect?
Only A
Only B
Both A and B
None
Revision Time
(int)
(float)
(bool)
(str)
datatypes
import pygame
pygame.init()
DARKBLUE=36,90,190
size=600,600
screen=pygame.display.set_mode(size)
screen.fill(DARKBLUE)
screen.display.flip()
DECISION MAKING IN PYTHON:
"if" statement
study_over=False
if study_over==True:
Print("Watch TV")
study_over=True
if study_over==True:
Print("Watch TV")
if (condition):
Execute
Execute
Execute
DECISION MAKING IN PYTHON
study_over=False
if study_over==True:
print("Watch TV")
else:
print("GO BACK TO STUDIES NOW!!")
if (condition):
Execute
Execute
Execute
else:
study_over=True
if study_over==True:
print("Watch TV")
else:
print("GO BACK TO STUDIES NOW!!")
DECISION MAKING IN PYTHON
Is my favourite show on?
DECISION MAKING IN PYTHON
Is my favourite show on?
study_over=False
show="Fav"
if study_over==True:
if show=="Fav:"
print("Watch TV")
else:
print("Play a game")
else:
print("GO BACK TO STUDIES NOW!!")
if (condition):
Execute
Execute
Execute
else:
if(condition):
else:
DECISION MAKING IN PYTHON
ORDER!!
ORDER!!
ORDER!!
No Order.
if food=="pakora":
print("Order pakora")
elif food=="samosa":
print("Order samosa")
elif food=="dosa":
print("Order dosa")
else:
print("No order here.")
if (condition):
Execute
Execute
Execute
else:
elif:
Loops:
while loop
while(condition):
Execute
Execute
Execute
Execute
parent_not_watching=True
while parent_not_watching==True:
print("Play mobile game")
parent_not_watching=False
print("STUDY!!")
Student additional activity 1
Calculator creation
- Create 3 variables:num1,num2, choice, and set values as you wish.(Note choice should be some value between 1 to 4)
- Create an if statement where based on valued of choice we perform different operations:
- choice=1:add the numbers
- choice=2:subtract the numbers
- choice=3:multiply the numbers
- choice=4:divide the numbers
- Print the answer.
Student additional activity 2
Table of 15
- Create a variable num=1
- Create a while loop that checks if num is less than 10
- Within the loop:
- Print the multiplication of 15 and num
- Increment num by 1
The battle field
By Sanjukta Bhattacharya
The battle field
- 112