1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Andru [333]
3 years ago
15

a. Write a function called fizzbuzz. This function will take 1 number as a parameter. The function will print all numbers from 0

up to the number input (non-inclusive), but, if the number is divisible by 2 you will print fizz instead, and if the number is divisible by 3 you will print buzz instead. If it is divisible by both you will print fizzbuzz

Computers and Technology
1 answer:
OLga [1]3 years ago
5 0

Answer:

def fizzbuzz (num):

 for item in range(num):

   if item % 2 == 0 and item % 3 == 0:

     print("fizzbuzz")

   elif item % 3 == 0:

     print("buzz")

   elif item % 2 == 0:

     print("fizz")  

   else:

     print (item)

fizzbuzz(20)

Explanation:

Using Python programming Language

Use a for  loop to iterate from 0 up to the number using the range function

Within the for loop use the modulo (%) operator to determine divisibility by 2 and 3 and print the required output

see attached program output screen.

You might be interested in
Which of these appliances can be classified as a robot? You can choose 2.
Natali [406]

Answer:

ummmm i think b

Explanation:

8 0
3 years ago
Read 2 more answers
A heart murmur is caused by incorrect operation of ________?​
Levart [38]

Answer:

the valves

Explanation:

science explains your questions answer. also did you know that the queen was an engineer in WWII? you probably did but you need 20 characters to submit an answere trust me it is the valves.

6 0
3 years ago
The scheme where you can find the greatest common divisor of two integers by repetitive application of the division algorithm is
gavmur [86]

Answer:

False

Explanation:

The scheme where you can find the greatest common divisor (GCD) of two integers by repetitive application of the division algorithm is known as Euclidean Algorithm.

The Euclidean Algorithm for calculating GCD of two numbers X and Y can be given as follows:

  • If X=0 then GCD(X, Y)=Y since the Greatest Common Divisor of 0 and Y is Y.
  • If Y=0 then GCD(X, Y)=X since the Greates Common Divisor of 0 and X is X.
  • Let R be the remainder of dividing X by Y assuming X > Y. (R = X % Y)
  • Find GCD( Y, R ) because GCD( X, Y ) = GCD(Y, R ).
  • Repeat the above steps again till R = 0.

4 0
3 years ago
Can you shorten this using Java Assignments (-=, +=, *=, etc.)?<br> “ second = first - second; ”
stepladder [879]

Answer:

YES YOU CAN sorry caps

Explanation:

5 0
3 years ago
A new version of an existing software program is considered a ________technology
inn [45]
Emerging and sustaining.
8 0
3 years ago
Other questions:
  • How fast is a backwards long jump in Super Mario 64?
    7·1 answer
  • Zoe runs a sports media website that caters to fans of many different types of sports. She's starting a Google Display Ads campa
    7·1 answer
  • Your school has been declared a school of technology
    15·1 answer
  • Tomahawk Industries develops weapons control systems for the military. The company designed a system that requires two different
    13·1 answer
  • The Office ____ is a temporary storage area. Warehouse Clipboard Storehouse Gallery
    15·1 answer
  • Museum web sites are generally good resources for information.<br> A.) True<br> B.) False
    11·2 answers
  • Use the drop-down menus to complete the statements about changing mail options in Outlook.
    10·1 answer
  • A VALENTINE
    5·2 answers
  • Any one know??please let me know
    15·2 answers
  • Thoughts on copyright?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!