Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please show all commands! Create a directory ~/assignments/assignment04 Create a

ID: 3549796 • Letter: P

Question

Please show all commands!


Create a directory ~/assignments/assignment04 Create an executable python script in that directory, and call it divide.py The program should read 2 command-line arguments, which you can assume are numbers. You should print: the result of dividing the first number by the second number, assuming they are integers the remainder (ie, modulus or modulo) of dividing the first number by the second, assuming they are integers the floating-point (ie, decimal) of dividing the first number by the second, assuming they are floating-point numbers

Explanation / Answer

import sys

print 'result of division is ',int(sys.argv[1])/int(sys.argv[2])
print 'remainder of division is ',int(sys.argv[1])%int(sys.argv[2])
print 'result of float division is ',float(sys.argv[1])/float(sys.argv[2])

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote