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
Luda [366]
2 years ago
13

Please help with this code!

Computers and Technology
1 answer:
kow [346]2 years ago
8 0

import random

months = ["jan", "feb", "mar", "apr", "may", "june", "july", "aug", "sept", "oct", "nov", "dec"]

pick1 = random.choice(months)

pick2 = random.choice(months)

if months.index(pick1) < months.index(pick2):

   print(pick1)

   print(pick2)

else:

   print(pick2)

   print(pick1)

Since the months are already in chronological order in the list, we can compare their index and print the string with the smaller index first. I wrote my code in python 3.8. I hope this helps.

You might be interested in
How to run angular project from github.
sergiy2304 [10]

Answer:

i have no ideaaaaaaaaaaaaaaaaaaaaaa

Explanation:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa kill me

6 0
2 years ago
Write a method that takes a RegularPolygon as a parameter, sets its number of sides to a random integer between 10 and 20 inclus
Sergio [31]

Answer:

import java.lang.Object

import java.lang.Math

public class RegularPolygon  extends java.lang.Object{

  public void randomize(RegularPolygon c){

       int min = 10, max1 = 20;

       double  min1 = 5, max1 = 12;

       double range = (max - min) + 1;

       double range1 = (max1 -min1) + 1

       int side = (Math.random() * range) + min;

       double len = (Math.random() * range1) + min1;

       c.setNumSides(side);

       c.setSideLength( len);

 }

 public static void main(String[] args) {

    RegularPolygon r = new RegularPloygon();

    randomize(r);

 }

}

Explanation:

The randomize method accepts a regular polygon class as its only parameter and assigns a random number of sides and the length of these sides with the 'Math.random' function.

5 0
3 years ago
An example of a(n) ____ reconnaissance attack is a user who sends SQL injections to a system in hopes of generating some type of
Elden [556K]
The answer to this question is A
7 0
3 years ago
Read 2 more answers
The section of the cpu that is responsible for performing mathematical operations.
nlexa [21]

The CPU executes arithmetic and logic operations in the arithmetic and logic unit (ALU).

<h3>What is an ALU, or an arithmetic and logic unit?</h3>
  • A combinational digital circuit known as an arithmetic logic unit computes arithmetic and bitwise operations on integer binary integers.
  • A floating-point unit, on the other hand, works with floating-point numbers.
  • The component of a central processing unit known as an arithmetic-logic unit performs arithmetic and logic operations on the operands in computer instruction words.
  • An Arithmetic Logic Unit (ALU) is a component found within computers that can execute logical operations in addition to arithmetic operations, such as AND, OR, Ex-OR, invert, etc (e.g. Addition, Subtraction, etc.).

To learn more about arithmetic and logic unit (ALU), refer to:

brainly.com/question/7994884

#SPJ4

4 0
1 year ago
What are computer engineering algorithms?
Tom [10]
An algorithm<span> is a well-defined procedure that allows a </span>computer<span> to solve a problem. Another way to describe an </span>algorithm<span> is a sequence of unambiguous instructions. ... In fact, it is difficult to think of a task performed by your </span>computer<span> that does not use</span>algorithms<span>.</span>
5 0
3 years ago
Other questions:
  • The Internet of Things (IoT) is a concept with emphasis on machine-to-machine communications to describe a more complex system t
    10·1 answer
  • A commonly used font style is _____. superscript periwinkle times new roman point
    7·1 answer
  • You must have an active ____ to test external links.
    5·1 answer
  • What happens when the following code segment executes if test.txt does not exist?:<br> A,B,C,D?
    7·1 answer
  • Which act requires that financial institutions must provide a privacy notice to each consumer that explains what data about the
    12·1 answer
  • Which feature of vitualization helps increase the IT productivity of a business?
    10·1 answer
  • Convert the decimal integer, 353.87510 to each of these forms:
    9·1 answer
  • What does not stand for​
    15·2 answers
  • Which are benefits of group discussions? Check all that apply. Learning becomes more interesting. Students engage in learning. L
    12·2 answers
  • Can somebody tell me the Minecraft command to clear an entire world and destroy every block if u Dunno please don’t answer &gt;-
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!