Curipod placeholder

Yr 11 Python Refresher

0
0
Profile picture of estaves

estaves

Updated 3 months ago

1. Slide
60 seconds
Welcome Back :)
This is a Python refresher. Please pair up and complete this with a friend.
2. Open question
210 seconds
Variables and Casting
What would be the output of this program? intNumber = 5 intNumber = intNumber + 10 strNumber = str(intNumber) strNumber = strNumber + "23" intNumber = int(strNumber) intNumber = intNumber MOD 5 intNumber = intNumber + 9 intNumber = intNumber / 5 intNumber = int(intNumber) print(intNumber)
3. Open question
210 seconds
What is wrong here?
intTemp = int(input("Please enter the temp: ")) if intTemp > 5 then     print("Oooooo it is a bit chilly.  You should definitely wear a coat, hat and gloves") elseif intTemp > 16 then     print("You had better put a jumper on!") elseif intTemp > 25 then     print("Oh how lovely.  You can go out in a T-shirt today")
4. Open question
210 seconds
What is wrong here?
intFavNum = int(input("Please guess my favourite number: ")) while intFavNum != 7     print("Try again!") endwhile      print("Hurray you cracked it.")
5. Open question
210 seconds
What is wrong here?
#My code will output the contents of this array. #What is wrong Rainbow = [“red”, “yellow”, “orange”, “green”, “blue”, “indigo”, “violet”] for i =1 to 7     print(Rainbow[i]) next i
6. Open question
210 seconds
What will these print statements produce?
strName = "Fred Bloggs" print(strName.substring(0, 3)) print(strName.substring(5, 6)) print(strName(10, 1))
7. Slide
60 seconds
Answer
Fre Bloggs s
8. Open question
210 seconds
What will the output be?
myArray = ["Red", "Orange", "Yellow", "Green", "Blue", "Indigo", "Violet"] print(myArray[3])
9. Slide
60 seconds
The End!

Suggested content