Presentation is loading. Please wait.

Presentation is loading. Please wait.

PYTHON PROGRAMMING Week 14 – Tuesday. STARTER You need to find out the average of a set of exam marks for a class. You don’t know how many marks there.

Similar presentations


Presentation on theme: "PYTHON PROGRAMMING Week 14 – Tuesday. STARTER You need to find out the average of a set of exam marks for a class. You don’t know how many marks there."— Presentation transcript:

1 PYTHON PROGRAMMING Week 14 – Tuesday

2 STARTER You need to find out the average of a set of exam marks for a class. You don’t know how many marks there will be. Each mark is in the range 0 to 100. Create an algorithm to solve this problem. Show your algorithm using pseudo-code, a structure chart and a flow chart. Don’t write the program in Python!!

3 LAST TERM AND THIS TERM All the basics for creating Python programs Tools to help design algorithms to solve problems This term – see web site.

4 TODAY Recap - binary Bitwise operators in Python Python practical

5 RECAP - BINARY Counting in binary – class discussion

6 RECAP - OPERATORS Arithmetic operators: +, -, *, /, ^^, % Relational operators:, =, ==, != Boolean operators: not, and, or

7 BITWISE OPERATORS – CLASS RESEARCH AND EXPLANATION Research each of these to find out what they do and give an example of each: << - shift bits left >> - shift bits right & - bitwise and | - bitwise or ~ - bitwise not – the ‘complement’ ^ - bitwise exclusive or You will need to explain one of these so make some notes.

8 EXERCISE Write down the binary representation of the denary number 19.  What denary number would you get if you apply the shift operator to shift:  once to the left?  twice to the left?  once to the right?  twice to the right?  What if you and it with 17?  What of you or it with 17?  What is its complement (not)?  What if you xor it with 17? Check these using IDLE (when completed and shown to me!)

9 PYTHON PRACTICAL Complete the bitwise operator exercises Codecademy  Where are you?  What is your target for this week?

10 PLENARY What are the bitwise operators – add one to board What does each one do?

11 TOMORROW Binary, hexadecimal and denary Conversion between these bases

12 HOMEWORK Read and make notes on section 5.1 pages 103 to 108 – answer questions 1 to 5.


Download ppt "PYTHON PROGRAMMING Week 14 – Tuesday. STARTER You need to find out the average of a set of exam marks for a class. You don’t know how many marks there."

Similar presentations


Ads by Google