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
hram777 [196]
3 years ago
11

Create the setStyles() function using the commands listed in the steps below. Christine wants one of five fancy style sheets to

be randomly used when the page is opened. Declare the styleNum variable equal to the value returned by the randInt() function, using 5 as the parameter value.
Computers and Technology
1 answer:
jolli1 [7]3 years ago
3 0

Answer:

Hi there! This can be implemented in a simple Python function which uses the "random" module to generate the number.

Explanation:

Using Python as the languge, we can write a the below code in a file called styles.py. The first line imports the randint function from the "random" module. The setStyles() function declares an array or 5 elements (here I have just used numbers but these could be string names of the stylesheets as well). Next, styleNum is assigned the random number and the associated stylesheet is selected from the array of stylesheets.

styles.py

from random import randint

def setStyles():

   stylesheets = [1,2,3,4,5];

   styleNum = randint(1,5);

   stylesheet = stylesheets[styleNum];

   print(stylesheet);

setStyles();

You might be interested in
Even with a good protocol, what are some privacy and security challenges while playing battleship on the internet simulator?
sweet [91]
<span>The Internet Simulator “broadcast” every message to every person in the group. Even with a good protocol, there are some privacy and security challenges while playing battleship on the internet simulator. Some of them are:</span><span>
- Broadcast mode allows all users to see all of the moves in plain text
- You do not know exactly who the message came from</span>

3 0
3 years ago
Read 2 more answers
Embedded computers usually are small and have limited hardware but enhance the capabilities of everyday devices. True or false?.
kati45 [8]

Embedded computers usually are small and have limited hardware but enhance the capabilities of everyday devices is a True statement.

<h3>Are embedded computers small?</h3>

Embedded computers are known to be machine that is said to be in smaller form  of their factor motherboards. An example is Mini-ITX .

Note that there are lot of Different forms of  embedded computers that has their specific innovative enclosure designs.

Therefore, based on the above, Embedded computers usually are small and have limited hardware but enhance the capabilities of everyday devices is a True statement.

Learn more about Embedded computers  from

brainly.com/question/9706390

#SPJ1

5 0
1 year ago
A compiler is a separate program that converts the entire source program into a machine language before executing it
NISA [10]
A compiler is a series of programs that (usually) convert source code into machine language. There are also compilers that compile into byte code, Java for instance.

No compiler is responsible for executing a freshly compiled program. That would be done in an IDE (Integrated Development Environment).
4 0
3 years ago
python Statistics are often calculated with varying amounts of input data. Write a program that takes any number of integers as
Veronika [31]

Answer:

The following are the program in the Python Programming Language.

#get input from the user

val = input("Enter the value: ")

#split the input values

x=val.split()

#declare and initialize two variables to 0

total, l = 0,0

#set for loop

for n in x:

 #coverting into string

 n = int(n)

 #perform addition

 total= total + n

 #check that is l is none or n is greater than l

 if(l is None or n > l):

   #initialize the value of n in l

   l = n

#print the following output

print("Average and maximum value are:", total // len(x), l)

<u>Output</u>:

Enter the value: 10 20 0 5

Average and maximum value are: 8 20

Explanation:

<u>Following are the description of the program</u>.

  • Firstly, declare a variable 'val' in which we get string type input from the user.
  • Again declare two variables and assigned them to 0.
  • Then set the for loop statement, in which we convert the string variable into the integer and perform addition with those converted values. Set the if conditional statement to check that if the variable 'l' is none or 'n' is greater than 'l ' then, assigned the value of the variable 'n' in the variable 'l'.
  • Finally, print the following result with message.
8 0
3 years ago
When will we go to mars?
melomori [17]
Its predicted a manned Mars mission to orbit the planet by the mid-<span>2030s</span>
7 0
3 years ago
Other questions:
  • What is the f(n) runtime of the following pseudocode: sum-0 for A = N/2 downto 1 for B-1 t increment sum by B Explain: exactly w
    13·1 answer
  • What type of program would use to create a personal budget?
    14·1 answer
  • Computers store temporary Internet files in the Recycle Bin. These files take up space and slow down a computer. Which tool can
    10·1 answer
  • What is a many-to many types of correspondence?
    5·1 answer
  • Developed by Frank Vahid. Write a program using integers usernum and x as input, and output usernum divided by x four times. For
    12·1 answer
  • The ________ option contains the formatting and placeholders for all of the items that appear on a side.
    11·1 answer
  • _____ is the management function that monitors the performance of the firm and makes improvements when necessary
    15·1 answer
  • If you increase the distance between two magnets, what will happen?
    15·2 answers
  • Information is best described as
    10·1 answer
  • How do I write a pseudocode algorithm to read a sequence of number terminated by the number 999 and print the sum of the positiv
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!