Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Penetration Testing with Python

You're reading from   Hands-On Penetration Testing with Python Enhance your ethical hacking skills to build automated and intelligent systems

Arrow left icon
Product type Paperback
Published in Jan 2019
Publisher Packt
ISBN-13 9781788990820
Length 502 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Furqan Khan Furqan Khan
Author Profile Icon Furqan Khan
Furqan Khan
Arrow right icon
View More author details
Toc

Table of Contents (18) Chapters Close

Preface 1. Introduction to Python 2. Building Python Scripts FREE CHAPTER 3. Concept Handling 4. Advanced Python Modules 5. Vulnerability Scanner Python - Part 1 6. Vulnerability Scanner Python - Part 2 7. Machine Learning and Cybersecurity 8. Automating Web Application Scanning - Part 1 9. Automated Web Application Scanning - Part 2 10. Building a Custom Crawler 11. Reverse Engineering Linux Applications 12. Reverse Engineering Windows Applications 13. Exploit Development 14. Cyber Threat Intelligence 15. Other Wonders of Python 16. Assessments 17. Other Books You May Enjoy

Python operators

An operator in Python is something that can carry out arithmetic or logical operations on an expression. The variable on which the operator operates is called the operand. Let's try to understand the various operators that are available in Python:

  • Arithmetic:
Functions Example
Addition a + b
Subtraction a - b
Negation -a
Multiplication a * b
Division a / b
Modulo a % b
Exponentiation a ** b
Floor Division a // b
  • Assignment:
    • a = 0 evaluates to a=0
    • a +=1 evaluates to a = a + 1
    • a -= 1 evaluates to a = a + 1
    • a *= 2 evaluates to a = a * 2
    • a /= 5 evaluates to a = a / 5
    • a **= 3 evaluates to a = a ** 3
    • a //= 2 evaluates to a= a // 2 (floor division 2)
    • a %= 5 evaluates to a= a % 5
  • Logical operators:
    • and: True: If both the operands are true, then the condition becomes true. For example, (a and b) is true.
    • or: True: If any of the two operands are non-zero, then the condition becomes true. For example, (a or b) is true.
    • not: True: This is used to reverse the logical state of its operand. For example, not (a and b) is false.
  • Bitwise operators:
Functions Example
and a & b
or a | b
xor a ^ b
invert ~ a
Right Shift a >> b
Left Shift a << b
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image