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]
3 years ago
13

9.3 Code Practice

Computers and Technology
2 answers:
Softa [21]3 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]3 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
Why Stockholder are interested in the way a company operate?
Ber [7]
They may want to buy stock if that company may be doing good
3 0
4 years ago
Which of the following is a reason why the comments tool within PDF documents could be helpful? (Select all that apply.)
sveta [45]
You can use it to suggest edits for the document.

You can use it to make a note of clarification for someone else examining the document.

You can use it to cover up mistakes within the document.

That's what I think.
7 0
3 years ago
Firestick optimizing system storage and applications loop
fiasKO [112]

Answer:

IF THIS DOES OCCUR THEN THE SYSTEM WILL AUTOMATICALLY CUT OFF WITH NO WARNING AT ALL...

Explanation:

ON WHAT INFORMATION AND RESEARCH HAS GIVEN ME IT WILL BE THE  AWNSER GIVEN AT THE TOP...

7 0
3 years ago
___________ is an unsecured client server application / protocol that transfers files between two computers.
Alexus [3.1K]
It is known as the File Transfer Protocol or FTP. It is based on a customer server demonstrate design and uses isolate control and information associations between the customer and the server. FTP clients may conform themselves with an unmistakable content sign-in convention, regularly as a username and secret word, yet can interface namelessly if the server is designed to permit it.
6 0
4 years ago
Which two keys are commonly used to move or insert data?.
vlabodo [156]

Answer:

control and shift

Explanation:

6 0
3 years ago
Other questions:
  • Does anyone know the point of gradpoint?
    8·1 answer
  • How to get the absolute value in coding begginners?
    13·2 answers
  • Giving Brainliest IFFF CORRECT
    9·1 answer
  • People using commercially available software are usually asked to read and agree to a(n) _____
    10·1 answer
  • 1. Use the Storyboard Template.
    11·1 answer
  • A browser allows you to set preferences for using the browser. These preferences include all of the following except
    7·1 answer
  • Sarah is a detail-oriented programmer. While testing her program, what other skill would she have to apply in order to detect al
    11·1 answer
  • When does the following while-loop stop running?
    10·1 answer
  • "Bookings are to be stored in three separate
    7·1 answer
  • With
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!