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
zloy xaker [14]
2 years ago
15

Write a program that generates 100 random numbers and keeps a count of how many of those random numbers are even and how many of

them are odd.
Computers and Technology
1 answer:
Anvisha [2.4K]2 years ago
8 0

Answer:

import random

numbers = []

even = 0

odd = 0

for i in range(100):

   numbers.append(random.randint(1, 200))

for i in range(100):

   if numbers[i] % 2 == 0:

       even += 1

   else:

       odd += 1

print("Even:", even)

print("Odd:", odd)

Explanation:

Gg ez.

You might be interested in
Hard disk works on the following technologies: (i) Technology used within the hard drive to read & write data to the drive a
Alex787 [66]

Answer:

The green-blue circuit board you can see in the first photo includes the disk controller, a circuit that allows the computer to operate the drive's mechanisms and read/write data to and from it. ... A small hard drive typically has only one platter, but each side of it has a magnetic coating

Explanation:

8 0
2 years ago
How to prevent water pollution​
loris [4]

Answer:

Here is your answer

Explanation:

1. pick up litter and throw it away in a garbage can.

2. use environmentally household products such as washing powder, household cleaning agents

3. wash your car or outdoor equipment where it can flow to a gravel or grassed area instead of a street.

4. don't throw waste at ocean it will harm the animals and create tocsin.

6 0
2 years ago
A company asked you help mitigate the brute force attacks carried out against its users' Windows account passwords. You successf
prohojiy [21]

Answer:

The following options are true.

Explanation:

A corporation has requested the user to support minimize the brute force attacks on credentials of their Microsoft account holder's. They effectively eliminated the malware involved in those assaults and have to protect their credentials allocated towards their user profiles properly without restricting the usefulness of the program.

The following should be included in securing the user accounts are need credentials for the user profile, create logon constraints that failed as well as need powerful credentials.

7 0
2 years ago
What is the chip that allows the screen to work
Luba_88 [7]

Answer:

V-chip technology works much like closed captioning and uses the vertical blanking interval in the television signal.

3 0
2 years ago
Read 2 more answers
Create a dictionary that will hold AT LEAST 3 categories for food with at least 3 foods for each category. E.g. Fruits --> Ap
RSB [31]

Answer:

  1. food_category = {
  2.    "Fruits": ["Apple", "Strawberries", "Orange"],
  3.    "Vegetables": ["Carrots", "Peas", "Onions"],
  4.    "Meats": ["Chicken", "Beef", "Mutton"]
  5. }
  6. for cat in food_category:
  7.    output = cat + ": "
  8.    for food in food_category[cat]:
  9.        output += food + ", "
  10.    print(output)
  11. answer = input("Do you want to add category or food (Y - Yes  N - No): ")
  12. while(answer == "Y"):
  13.    choice = input("New Category (N) or New Food (nf): ")
  14.    
  15.    if(choice == "N"):
  16.        new_cat = input("Enter new category name: ")
  17.        if(new_cat not in food_category):
  18.            food_category[new_cat] = ""
  19.    elif(choice == "nf"):
  20.        cat = input("Enter category: ")
  21.        new_food = input("Enter new food name: ")  
  22.        food_category[cat].append(new_food)
  23.    
  24.    answer = input("Do you want to add new category or food (Y - Yes N - No): ")
  25. print("All food categories: ")
  26. for cat in food_category:
  27.    print(cat)
  28. selected_cat = input("Select a category to view the food list: ")
  29. output = ""
  30. for food in food_category[selected_cat]:
  31.    output += food + ", "
  32. print(output)

Explanation:

The solution code is written in Python 3.

Firstly, create a food category dictionary data structure (Line 1 -5). Next, display all the food category and the food in each category (Line 7 - 11)

Next prompt user to feedback if they wish to add new category or new food (Line 13).

While the answer is yes prompt user to enter their choice, either category or food and use if else if statements to handle the choice made by the user. If the choice is new category, prompt user to enter new category name and check if the new category is already exist in the dictionary. If not, add that category to dictionary (Line 18 - 21).

If the choice is food, nf, prompt user to input food category and enter the new food name and add it to the food_category list (Line 22 - 25).

After that prompt user to enter if they wish to continue to add new data (Line 27).

After collecting all info from user, write a for loop to display all the categories (Line 29 - 31).

At last, prompt user to select a category and display all the food of the selected category (Line 33 - 37).

8 0
2 years ago
Other questions:
  • What human activity would cause a decrease in the population of another species? (The action of humans would impact one species,
    9·1 answer
  • Jeremy, a college student, is preparing to give a speech on "Social Responsibilities." He refers to a Web page on a tab using
    10·1 answer
  • What identifies available computers through the internet?
    14·1 answer
  • Which is an example of a zero-point perspective?
    11·1 answer
  • __________ offers a mechanism to accomplish four security goals: confidentiality, integrity, authentication, and nonrepudiation.
    9·1 answer
  • ___________________ are aggregated collections of memory and cpu resources that can be shared among groups of virtual machines o
    11·1 answer
  • Which of these might be an example of an advertiser's target group?
    12·2 answers
  • What do you call a commercial transaction beyween a buisness and buisness thatis transactedd online?
    7·1 answer
  • Write a program to find all integer solutions to the equation 4x + 3y -9z = 5 for values of x, y, and z between 0 to 100.
    11·1 answer
  • Capstone Project part 11 quiz
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!