
Understanding Programming Operators and Techniques
Explore the significance of operators in programming, covering arithmetic, boolean, and string manipulation. Learn about BODMAS, arithmetic calculations, Python operators, and practical examples. Enhance your skills from beginner to expert levels in handling data efficiently using a variety of operators.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
Keywords Arithmetic, Boolean, String, Concatenate (join), Substring, Delimiter, SPLIT, left, mid, right, Addition, Subtraction, Division, Modular division, Integer division, Negation, AND, OR, NOT, Greater than, Less than, Equal, Not equal, Modulus, Quotient, Exponentiation Programming Techniques Operators
Operators Once we have the information that we received from inputs or hard-coded (typed in when designing) in the program we need to manipulate this data calculate, compare, etc. Operators represent the operations that are performed on the data. You already know operators in Maths, e.g. +, -, /, *, ^, etc. Objectives BEGINNER: Identify different operators used in programming. ADVANCED: Use the most appropriate arithmetic, Boolean and string operators in different situations. EXPERT: Manipulate strings using different operators.
Questions What is BODMAS? Why is it important to know it? What does the following calculation give? (10 * 4) / 5 10 /1 * 0 = ??? Find out what operators you can use in python. Add a sentence and example of each one in use Why do we need this? Objectives BEGINNER: Identify different operators used in programming. ADVANCED: Use the most appropriate arithmetic, Boolean and string operators in different situations. Without operators and correct order for calculations, we can get in a mess! We need strict rules to ensure results are as intended. Operators cover a wide range of activities in programming. EXPERT: Manipulate strings using different operators.
Operators in Use Numbers: addition, subtraction, division, modular division (division with a remainder), integer division, multiplication, to-the-power-of, negation Objectives BEGINNER: Identify different operators used in programming. Boolean: AND, OR, NOT, larger, smaller, equal, not equal Strings/characters: slicing, length, format ADVANCED: Use the most appropriate arithmetic, Boolean and string operators in different situations. + Addition e.g. x = 6 + 5 gives 11 - Subtraction e.g. x = 6 - 5 gives 1 * Multiplication e.g. x = 12 * 2 gives 24 / Division e.g. x = 12 / 2 gives 6 EXPERT: Manipulate strings using different operators. MOD Modulus e.g. 12 MOD 5 gives 2 DIV Quotient e.g. 17 DIV 5 gives 3 ^ Exponentiation e.g. 3^4 gives 81
Operators in Use Objectives BEGINNER: Identify different operators used in programming. ADVANCED: Use the most appropriate arithmetic, Boolean and string operators in different situations. EXPERT: Manipulate strings using different operators. Logical operators only used with Booleans AND - OR - NOT
Operators in Use Objectives BEGINNER: Identify different operators used in programming. ADVANCED: Use the most appropriate arithmetic, Boolean and string operators in different situations. EXPERT: Manipulate strings using different operators.
MOD: Finding out Divisibility We often have to break items into groups. (a) how many full football teams can be made from 53 pupils (b) how many pupils will be without a team? Objectives BEGINNER: Identify different operators used in programming. Division could be used to solve (a) Integer division is division which ignores the remainder. 53 DIV 11 = 4 ADVANCED: Use the most appropriate arithmetic, Boolean and string operators in different situations. (b) can be solved through modulus division . Modulus gives the remainder left by diving one number with another 53 MOD 11 = 9, in other words 9 pupils would be without a team. EXPERT: Manipulate strings using different operators.
String Operations Objectives BEGINNER: Identify different operators used in programming. ADVANCED: Use the most appropriate arithmetic, Boolean and string operators in different situations. EXPERT: Manipulate strings using different operators.
String Operations (Pseudocode) Objectives BEGINNER: Identify different operators used in programming. ADVANCED: Use the most appropriate arithmetic, Boolean and string operators in different situations. EXPERT: Manipulate strings using different operators.
String Operations (Examples) Objectives BEGINNER: Identify different operators used in programming. ADVANCED: Use the most appropriate arithmetic, Boolean and string operators in different situations. EXPERT: Manipulate strings using different operators.
String Operations (Activity) Objectives BEGINNER: Identify different operators used in programming. Given these two variables: string A ="Great to see you!" string B="Britain to get showers overnight. ADVANCED: Use the most appropriate arithmetic, Boolean and string operators in different situations. Use string operators and pseudocode to get the following strings: 1. "GREAT BRITAIN" 2. "TO SEE GREAT BRITAIN" EXPERT: Manipulate strings using different operators.
Boolean Operators Objectives BEGINNER: Identify different operators used in programming. ADVANCED: Use the most appropriate arithmetic, Boolean and string operators in different situations. EXPERT: Manipulate strings using different operators.
Boolean Example Objectives BEGINNER: Identify different operators used in programming. ADVANCED: Use the most appropriate arithmetic, Boolean and string operators in different situations. EXPERT: Manipulate strings using different operators.
Answer Objectives BEGINNER: Identify different operators used in programming. ADVANCED: Use the most appropriate arithmetic, Boolean and string operators in different situations. EXPERT: Manipulate strings using different operators.