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

Write a Python program segment, using a loop, to calculate and print the sum of the odd integers from 20 to 120. (Hint: 21 23 25

. . . 117 119)
Computers and Technology
1 answer:
julsineya [31]3 years ago
4 0

Answer:

for x in range(20,120):

   if x % 2 == 0:

       continue

   print(x)

Explanation:

in a range of 20 to 120 it does the following, if x is divisible by two as an int, then try again with a new number. If not, print that number.

You might be interested in
Which of the following is the shortcut key combination for pasting copied text?
lys-0071 [83]
Ctrl + v pastes copied text, ctrl + p brings up a print menu, ctrl + x cuts and copies highlighted text, while ctrl + c copies the highlighted text.
3 0
3 years ago
Read 2 more answers
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
Write a program to test your functions as follows: Obtain a random number seed from the command line of your program using comma
Iteru [2.4K]

Answer:

Please find the code attached.

Explanation:

Please find the attached code in pictures.

7 0
3 years ago
Which type of chart is best for highlighting trends in data?
STALIN [3.7K]
Pie chart I believe that is the right answer

8 0
3 years ago
Read 2 more answers
Which of the following is not a property of a constructor?A. The name of a constructor can be chosen by the programmerB. A const
inna [77]

Answer:

The answer is "Option A"

Explanation:

The constructor is a special member function whose task is to initialize an object from its class, and it doesn't return any value like int, float, double, etc. Its name and class name will always be the same, and when we create the class object so, the constructor is automatically called, and it may be overloaded, that's why we can say that except the "choice A", all were correct.

4 0
3 years ago
Other questions:
  • How can u refer to additional information while giving a presentation
    15·1 answer
  • Under which market structure, does a firm have the most influence over product pricing? A. Oligopoly B. Perfect competition C. M
    5·1 answer
  • How would you define the rule of thirds?
    11·1 answer
  • Which of the following are the dimensions of feasibility? Group of answer choices cost, schedule, technical, and organizational
    14·1 answer
  • A coffee shop is considering accepting orders and payments through their phone app and have decided to use public key encryption
    10·1 answer
  • How many constructors are there in the following class declaration?class CashRegister { public: CashRegister(); CashRegister(int
    8·1 answer
  • A ____ is a a set of presentation rules that control how text should look. It is applied to an XML file to change the collection
    9·1 answer
  • Which of the following describe audio-editing software? Choose all that apply.
    5·2 answers
  • Define foreign employment​
    5·1 answer
  • How do people and computers approach problems differently
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!