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]
4 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]4 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
A methods and measurements analyst for Digital Devices needs to develop a time standard for the task of assembling a computer mo
Karo-lina-s [1.5K]

Answer:

34 seconds

Explanation:

Contingencies are not co soldered in the observed time because the time an individual takes to college a particular task is called observed time.

As the worker takes 34 seconds minimum to complete the task so 34 seconds is the answer.

4 0
3 years ago
8.9 Code Practice
jolli1 [7]

Answer: Here you go, change it however you like :)

Explanation:

v = [24, 20, 29, 32, 34, 29, 49, 46, 39, 23, 42, 24, 38]

usr = int(input("Enter number: "))

print(f"Index: {v.index(usr)}") if usr in v else print(-1)

5 0
3 years ago
Read 2 more answers
What general (system) recommendations might you make to the shop manager? (For example. if the system will be integrated, what m
Amiraneli [1.4K]

Answer:

Explanation:

1. 2 Modules that can be used for systems

integrations are

A. Automation integration modules

B. Flownex integration modules

2. Benefit of systems integration

A. It helps improves efficiency in integrating with external softwares

B. It helps with business to businesses communications and enhances interrnal co-operation within organization.

4 0
4 years ago
Which elements of a myth appear in this story from early babylon
g100num [7]
-a setting that may be fake
- Supernatural being/character
- Conflict/ the plot of the story
7 0
3 years ago
write a single expression that will return true if the lower four bits of x are the same as the lower four bits of y
horrorfan [7]

A single expression that will return true if the lower four bits of x are the same as the lower four bits of y is; (x & 0x0F) == (y & 0x0F)

<h3>How do you write single expression programs?</h3>

There are different methods of writing programs such as python and others. However, in this case, it is pertinent to know that this compiler that will return true if the lower four bits of x are the same as the lower four bits of y doesn't accept binary constants and as such we will use hexidecimal instead. For example; for 0b00111111, we will use 0x3F.]

Thus, using that same concept above, the single expression that will return true if the lower four bits of x are the same as the lower four bits of y is; (x & 0x0F) == (y & 0x0F)

Read more about writing computer programs at: brainly.com/question/16397886

6 0
2 years ago
Other questions:
  • What is the core of an operating system that manages memory and devices, maintains the computer’s clock, starts programs, and as
    7·1 answer
  • You can create user accounts on the linux system by using the ____ command.
    9·1 answer
  • If someone receives a shock, or a piece of equipment is throwing sparks or arcing you should try to pull them away from the sour
    7·1 answer
  • How to transfer photos from iphone to iphone?
    14·2 answers
  • A restaurant has a case type that allows customer to book the dining room for events. Customers provide basic information includ
    7·1 answer
  • Which of the following plug-ins was developed by microsoft and is a software development tool used to write and run internet app
    10·1 answer
  • 1. Write a program that grades arithmetic quizzes as follows: (4 points) a. Assume there are 23 questions in the quiz. b. Ask th
    10·1 answer
  • Which feature of a website takes you to a different part of the website or a totally different website when you click on it?
    12·2 answers
  • Which tasks can be completed using the Chart Tools Design tab? Check all that apply.
    9·1 answer
  • Which web design concept is most closely related to elements that symbolize the real world​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!