Programming Using Python Day 2 Presentation (pages 12, 13)
Think you've got it?
Programming Using Python Day 2 Review
1.What is wrong with the code in Figure A?
2.Write a function that returns "a is greater than b", "a is less than b", or "a is equal to b" depending on the values of two int input params a and b.
3.What's the output of the code in Figure A?
4.Evaluate the boolean expressions shown in Figure A.
5.Provide values for a, b, and c that make the following statement evaluate as True:
a + b == c and (c is a or c is b) and a != b
6.What do the boolean operators and, or, and not do in Python?
7.What is an if statement?
8.What are some good strategies to introduce if statements to students?
9.What is a truth table?
10.In Python, if/else statements are used to control the flow between two different options. How can we control the flow between more than two different options?
11.What is a flowchart?
12.Create a flowchart in Jamboard that asks the user for two numbers then either (a) prints the product of the two numbers if the first number is larger than the second number or (b) prints the sum of the two numbers otherwise. Upload a screenshot of your flowchart.
13.Explain what's happening in the flowchart in Figure A.
14.Explain what's happening in the flowchart in Figure A.
15.Create a flowchart in Jamboard that continues to ask the user for input until they enter an odd number, then prints that number.
16.What's a Parson's Problem?
17.Adjust the provided code so that print(a) prints the frog is on the log.
18.Write an example Parson's Problem that you could have students solve.
19.Adjust the provided code so that print(total) prints 15.
20.Adjust the provided code so that Wednesday is my favorite day of the week. is printed.