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]
2 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]2 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
g Design a Boolean function called isPrime, that accepts an integer as an argument and returns True if the argument is a prime n
professor190 [17]

Answer:

#include <bits/stdc++.h>

using namespace std;

bool isPrime(int n)

{

   for(int j=2;j<=n-1;j++)  //loop to check prime..

   {

       if(n%j==0)

       return false;

   }

   return true;

}

int main(){

   int n;

   cout<<"Enter the integer"<<endl;//taking input..

   cin>>n;

   if(isPrime(n))//printing the message.

   {

       cout<<"The number you have entered is prime"<<endl;

   }

   else

   {

       cout<<"The number is not prime"<<endl;

   }

return 0;

}

Output:-

Enter the integer

13

The number you have entered is prime

Explanation:

The above written program is in C++.I have created a function called isPrime with an argument n.I have used a for loop to check if the number is prime or not.In the main function I have called the function isPrime for checking the number is prime or not.

4 0
3 years ago
Provide a status report to your classmates and instructor. Describe any modifications that you have made to the design or docume
Pavel [41]

Answer:

that's muddled up I can't make out the question

3 0
3 years ago
An array subscript can be an expression, but only as long as the expression evaluates to what type?
densk [106]

Integer Integer Integer Integer Integer Integer Integer Integer Integer Integer Integer Integer Integer Integer Integer

6 0
3 years ago
This is for C++: Using a nested for loop output the following pattern to the screen:
olga55 [171]

Answer:

Following are the code to the given question:

#include <iostream>//header file

using namespace std;

int main()//main method

{

int r=26,x,y;//defining integer variable  

char c;//defining a character variable

for(x= 1; y<= r; x++)//using for loop for count value

{

for(y= 1; y<= x; y++)//using for loop to convert value in triangle  

{

c=(char)(y+64);//convert value into character  

cout << c;//print character value

}

cout << "\n";//use print method for line break

}

return 0;

}

Output:

Please find the attachment file.

Explanation:

In this code, three integer variable "x,y, and r", and one character variable "c" is declared, that is used in the nested for loop,  in the first for loop it counts the character value and in the next for loop, it converts the value into a triangle and uses the char variable to print its character value.

3 0
2 years ago
Which process could you use to add a table to a document?
Lady_Fox [76]
These are the steps you would take..

click on insert at the bar on the top of the document  processor (Word,Google Docs ect.) >>Click table drag as many columns and rows as you need!
I hope this helps!
6 0
3 years ago
Other questions:
  • The rmdir command (with no options) can only remove empty directories <br> a. True <br> b. False
    14·1 answer
  • Unlike artistic drawings, which communicate self-expression and
    15·1 answer
  • Which protocol is used by the client for microsoft networks and file and printer sharing for microsoft networks to communicate w
    10·1 answer
  • Question 1 (1 point)
    10·2 answers
  • Rint "Censored" if userInput contains the word "darn", else print userInput. End with newline.
    11·1 answer
  • You can avoid culture shock by ____________.
    10·2 answers
  • Write a program in Python that reads in investment amount, annual interest rate, and number of years, and displays the future in
    6·1 answer
  • All of the following are aspects of the search process except?
    6·2 answers
  • Does the estimate of a tolerance level of 68.26% of all patient waiting times provide evidence that at least two-thirds of all p
    13·1 answer
  • How to send an email to multiple recipients individually outlook
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!