Answer to Question #155730 in Python for Mohammad Atif

Question #155730

6 nails, 4 glass pieces and 2 brass handles are required for one window. There are 'N' no. Of windows in a room and 'M' such room in my house , Write a program to calculate total no. Of nails,glasspieces and brass handles will be required


1
Expert's answer
2021-01-14T13:21:04-0500
# windows.py
nails_per_window = 6
glasses_per_window = 4
handles_per_window = 2

# number of windows per room
N = int(input("Number of windows per room "))
# number of rooms
M = int(input("Number of rooms "))

windows = N * M
nails = nails_per_window * windows
glasspieces = glasses_per_window * windows
brass_handles = handles_per_window * windows

print(f'{nails} nails, {glasspieces} glass pieces and {brass_handles}'
      ' brass handles are required.')

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS