Are you sure this is the right subject
.col-used by post secondary educational institutions
Answer:
a=int(input("Enter a numerator: "))
b=int(input("Enter a divisor: "))
quotient=a/b
remainder=a%b
print("Quotient is: " + str(int(quotient)))
print("Remainder is: " + str(int(remainder)))
Explanation:
Hope this helps lovely :)
Answer:
import os, sys, stat
from stat import *
command = 'find ' + sys.argv[1] + ' -name *' + sys.argv[2] + '*'
print(command)
totalFiles = os.popen(command).read()
totalFiles = totalFiles.split()
totalSize = 0
for line in totalFiles:
statinfo = os.stat(line)
if stat.S_ISREG(statinfo.st_mode):
print(line, statinfo.st_size, 'bytes')
totalSize += statinfo.st_size
else:
print(line, '...')
print('Total file size:', totalSize, 'bytes')
Explanation:
- According to command line arguments, build the find command.
- Store the product by executing the command.
- Loop through all files in the output list using the for loop.
- Display the file name and size, If the file is regular otherwise just display the file name.