operand
A value an operator works on, such as 7 and 2 in 7 - 2.
In more detail
The types of the operands decide what an operator does: + on two numbers adds, on two strings joins, and on a number and a string raises TypeError. With // and %, negative operands give results that surprise people used to other languages.
Related terms
- arithmetic operator — A symbol that does arithmetic on numbers: + add, - subtract, * multiply, / divide, // floor divide, % remainder and ** power.
- TypeError — The exception raised when an operation or function gets a value of the wrong type, such as adding a number to a string.
Taught in
- Division, Quotients And Remainders — Hands-on Python: Complete Video Course & Book
- Strings, Delimiters And Concatenation — Hands-on Python: Complete Video Course & Book
- Input, And Numbers Versus Digits — Hands-on Python: Complete Video Course & Book
- Floats, Division And Mixed Types — Hands-on Python: Complete Video Course & Book
- Any Type As A Condition — Hands-on Python: Complete Video Course & Book
- Conditions The Exam Loves — PCEP Certified Entry-Level Python Programmer (PCEP-30-02) Exam Prep
- Special Methods: __str__, __eq__ And Friends — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep