Question: 1. Please write a program in Python 3 for the followng instructions. Please also show all outputs and share code. Program Write a program that
1. Please write a program in Python 3 for the followng instructions. Please also show all outputs and share code.
Program
Write a program that prints the numbers from 1 to 150, except . . .
When you get a number that's divisible by 3, print "Fizz" instead.
When you get a number that's divisible by 5, print "Buzz" instead.
When you get a number that's divisible by 7, print "Woof" instead.
If a number is divisible by several of these values, print the appropriate words in the corresponding order. For example, for 15 you should print "Fizz Buzz", for 35 you should print "Buzz Woof", and for 105 you should print "Fizz Buzz Woof".
Consider learning how to write Python functions now, to help reduce the overall number of lines of code you write. Function come next lesson, but are one of the fundamental programming constructs in any language. Embrace them.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
