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
Select the correct answer from each drop-down menu. Rita runs a small business that designs custom furnishings for corporate cli
LUCKY_DIMON [66]

Software as a Service cloud model is ideal for Rita’s business. SaaS are office solutions that allow Rita’s small business to work more efficiently and in a more organized way. Most SaaS applications are used for invoicing and accounting, sales, performance monitoring, and overall planning. SaaS applications can save Rita money. They do not require the deployment of a large infrastructure at her location. As a result, it drastically reduces the upfront commitment of resources. Whoever manages SaaS’s IT infrastructure running the applications brings down fees for software and hardware maintenance. SaaS has generally been acknowledged to be safer than most on-premise software.

5 0
3 years ago
Read 2 more answers
Your manager has tasked you with implementing security controls to mitigate IP spoofing attacks against your network. IP spoofin
Ipatiy [6.2K]

Answer:

You can setup firewall rules with for example iptables on Linux. The rules should block source addresses of private IP ranges such as 192.168.*.* and 10.*. *. * etc. Check private IP ranges for full list.

It will however not guarantee prevention of IP spoofing in general as its not possible to prevent such attacks. Its the responsibility of ISPs. But the question asked for private IP spoofing and then the above works.

4 0
3 years ago
What is a bin range?
S_A_V [24]
The answer will be A! hope i helped!
4 0
3 years ago
What is included in a linked list node?
Annette [7]

Explanation:

In its most basic form, each node contains:

data, and a reference (in other words, a

link) to the next node in the sequence. A

linked list whose nodes contain two fields:

an integer value and a link to the next node.

The last node is linked to a terminator used

to signify the end of the list.

8 0
3 years ago
A small monster collector has captured ten Bagel-type small monsters. Each Bagel-type small monster has a 35% chance of being a
Doss [256]

Answer:

Check the explanation

Explanation:

Each Bagel-type small monster has 0.35 probability of being a Sesame Seed-subtype and 0.2 probability of being a Whole Wheat-subtype.

The probability that exactly 8 of them are Whole Wheat-subtype is \binom{10}{8}(0.2)^8(0.8)^2 using multiplication principle, because first need to choose which 8 are Whole Wheat-subtype, and if exactly 8 of them are Whole Wheat-subtype, then other two are not Whole Wheat-subtype. The former has probability 0.2, while the latter has probability 1-0.2 = 0.8 .

Kindly check the attached images below for the complete answer to the question above

6 0
3 years ago
Other questions:
  • Keith has to carry out a photo shoot to capture images of the ocean during the monsoons. What is a recommended practice when sho
    9·1 answer
  • To create a formula in ___ you would first click in one of the cells. A.word b.excel c.facebook d.powerpoint
    13·1 answer
  • The loss of privacy data has implications:
    5·1 answer
  • Give state diagrams of DFAs that recognize the following languages.
    6·1 answer
  • According to the video, which of the following is communication between two individuals? Intrapersonal Communication Public Spea
    7·2 answers
  • How do you respond to an email?
    6·1 answer
  • What is the main component of the EV3 Lego Robot called?​
    6·1 answer
  • What are the steps for inserting an internal link?
    15·2 answers
  • MULTIPLE CHOICE QUESTION
    14·2 answers
  • What are the different types of monitors?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!