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
postnew [5]
2 years ago
13

9.3 Code Practice

Computers and Technology
2 answers:
Softa [21]2 years ago
7 0

Answer:

import random

numbers = []

for r in range (4):

   numbers.append([])

for r in range(len(numbers)):

   for c in range(5):

       numbers[r].append(random.randint(-30,30))

for r in range(len(numbers)):

   for c in range (len(numbers[0])):

       print((numbers[r][c]), end = " ")

   print("")

Explanation:

ok

julsineya [31]2 years ago
5 0

Answer:

import random

def grid_maker(x, y):

   return [ [str(random.randint(-30, 30)) for _ in range(x)]for _ in range(y) ]

print ('\n'.join(' '.join(row) for row in grid_maker(4, 5)))

Explanation:

We use a template function and we generate numbers between -30 and 30:

>>> [str(random.randint(-30, 30))]

We also use the str() method so we can later concatenate the integers with \n. If you do not specify the integers, it will cause a crash. Also, keep in mind if we use a variable to store the integers, it will come out more of like a seed than a random grid. For instance, output without the random integers in a variable:

-12 16 -18 -3

7 5 7 10

18 -21 -16 29

21 3 -4 10

12 9 6 -9

Vs with a variable:

-25 6 -25 -20

-25 6 -25 -20

-25 6 -25 -20

-25 6 -25 -20

-25 6 -25 -20

Next we specify the  x and the y:

>>> for _ in range(x)]for _ in range(y) ]

Next we just print it and create a new line every time a row is made

hope this helped :D

You might be interested in
Dynamic disk storage provides the flexibility to logically organize disk space across one or more disk drives.
zhuklara [117]
<span>Dynamic disk storage provides the flexibility to logically organize disk space across one or more disk drives. 
a. True 
b. False</span>
3 0
3 years ago
A sample member of the list data is a1 = ['male', True] where the second item is True if the person is on the phone.
Ira Lisetskai [31]
Answer:

0

Explanation:
In the lists, indexation starts from 0, because of that in if statement we compare item[0] which is 'male' and 'male', and then males is itterated within for loop.
8 0
2 years ago
Read 2 more answers
Suppose there are 10 computers on a network that are configured to share a few printers and a single document folder. The compan
ivanzaharov [21]

Answer:

B- Workgroup model

Explanation:

A workgroup model can be defined as a process which enables system to be peer together in order to access the resources shared like files and printers at the same time.

In work group microsoft operating systems tend to share files, printers, and even Internet connection among them which is why work group is important especially in a place in which their are various computers with limited files and printer or internet connection.

4 0
3 years ago
BIOS has two jobs. One is to boot up, or start, the computer. What is the other? Maintain the computer’s software firewall. Ensu
Levart [38]

Answer:

Provide the basic interface for the hardware.

Explanation:

3 0
3 years ago
In cell E13, create a formula using the AVERAGE function
lukranit [14]
USE SOCRACTIC IT WOULD REALLY HELP WITH QUESTIONS LIKE THIS
3 0
3 years ago
Read 2 more answers
Other questions:
  • Which term refers to actions that you would typically perform on a computer to revive it if it functions in an unexpected manner
    15·2 answers
  • Consider tree from the lectures on slide 10, write down the nodes in order as pro-
    6·1 answer
  • Design two subclasses of Employee…SalariedEmployee and HourlyEmployee. A salaried employee has an annual salary attribute. An ho
    12·1 answer
  • Which of these are forms of data? Check all that apply.
    8·2 answers
  • Which of the following is true of how packets are sent through the Internet?
    11·2 answers
  • Package Newton’s method for approximating square roots (Case Study: Approximating Square Roots) in a function named newton. This
    7·1 answer
  • Global address list characteristics
    11·1 answer
  • Hey good to mett you
    15·1 answer
  • 4.8 code practice question 2 edhesive
    12·1 answer
  • Reading (BCK FORM 2C IT 2020-2021)
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!