...
Code Block |
---|
course = "Course Name" index = course.find("u") print(index) #or to get True/False if an substring exists using IN found = "Name" in course print (found) |
Arithmetic Operators
Operator | Description | Example |
---|---|---|
+ | plus | 10 + 3 = 13 |
- | minus | 10 - 3 = 7 |
* | multiply | 10 * 3 = 30 |
/ | divide - returns float | 10 / 3 = 3.333 |
// | divide (whole number) | 10 // 3 = 3 |
% | modulus - remainder of division | 10 % 3 = 1 |
** | exponent | 10 ** 3 = 1000 |
+=, *=, ... | Augmented Assignment Operators | x+=3 = x=x+3 |
Code Block |
---|
Cheat Sheet
References
...