- Learning Python for Forensics
- Preston Miller Chapin Bryce
- 229字
- 2021-08-20 10:17:03
Understanding scripting flow logic
Flow control logic allows us to create dynamic operations by specifying different routes of program execution based upon a series of circumstances. In any script worth its salt, some manner of flow control is present. For example, flow logic would be required to create a dynamic script that returns different results based on options selected by the user. In Python, there are two basic sets of flow logic: conditionals and loops.
Flow operators are frequently accompanied by flow logic. These operators can be strung together to create more complicated logic. The following table represents a truth table and illustrates the value of various flow operators based on the A or B variable Boolean state:

The logical AND and OR operators are the third and fourth columns in the table. Both A and B must be True for the AND operator to return True. Only one of the variables needs to be True for the OR operator to be True. The not operator simply switches the Boolean value of the variable to its opposite (for example, True becomes False and vice versa).
Mastering conditionals and loops will take our scripts to another level. At its core, flow logic relies on only two values, True or False. As noted earlier, in Python, these are represented by the Boolean True and False data types.
- CTF實(shí)戰(zhàn):技術(shù)、解題與進(jìn)階
- Mobile Forensics Cookbook
- API安全實(shí)戰(zhàn)
- Kali Linux Social Engineering
- 工業(yè)互聯(lián)網(wǎng)安全
- Metasploit Penetration Testing Cookbook(Second Edition)
- INSTANT Windows PowerShell
- Spring Security(Third Edition)
- CTF競(jìng)賽權(quán)威指南(Pwn篇)
- 隱私計(jì)算
- 計(jì)算機(jī)網(wǎng)絡(luò)安全基礎(chǔ)(第5版)
- 數(shù)據(jù)安全領(lǐng)域指南
- 數(shù)字政府網(wǎng)絡(luò)安全合規(guī)性建設(shè)指南:密碼應(yīng)用與數(shù)據(jù)安全
- 網(wǎng)絡(luò)空間安全:拒絕服務(wù)攻擊檢測(cè)與防御
- 網(wǎng)絡(luò)安全實(shí)戰(zhàn)詳解(企業(yè)專供版)