Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Session 03 - Python for Forensics

The code here is to support the Session 03 lecture.

simplemaths2.py

def convertInteger(numberStr):
    convertedInt = int(numberStr)

    return convertedInt

def sum(numberOneStr,numberTwoStr):
    numberOneInt = convertInteger(numberOneStr)
    numberTwoInt = convertInteger(numberTwoStr)

    result = numberOneInt + numberTwoInt

    return result

numberOneStr = input("Please enter the first number: ")
numberTwoStr = input("Please enter the second number: ")

answer = sum(numberOneStr,numberTwoStr)

print("Answer is: " + str(answer))
[ Last updated: Tuesday 13 February 2024 @ 11:22:49 +0000 // branch: master // commit: bd41815 ]