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
ycow [4]
3 years ago
7

Write a list comprehension statement to generate a list of all pairs of odd posi

Computers and Technology
1 answer:
egoroff_w [7]3 years ago
7 0

Answer:

Print([(a,b) for a in range(10) for b in range(10) if (a < b and a%2 == 1 and b%2 == 1)])

Explanation:

Here, we declared a range of value for a and b using a for loop and the range function. The values are the first 10 numeric digits. The we used the if statement to establish our constraints;

In other to ensure that ;

Lower digit is written first ; (a < b) ;

Only odd numbers are considered,

a%2 == 1 ; b%2 == 1 (remainder when a and b are divided by 2 is 1.

Both a and b are declared as a tuple in other to obtain a pair of odd values.

You might be interested in
A program is required to three (3) numbers. calculate and print their total
podryga [215]

A program that is required to three (3) numbers. calculate and print their total is given below:

<h3>The Program</h3>

import java.util.Scanner;

public class SumAndAverage {

public static void main(String[ ] args) {

System.out.println("Enter three numbers - ");

// Accepting and finding sum of numbers.

int sum = 0;

Scanner sc = new Scanner(System.in);

for (int i = 0; i < 3; i++)

sum += sc.nextInt( );

// Printing sum and average.

System.out.println("Sum - " + sum);

System.out.println("Average - " + (sum / 3f));

}

}

The output would request three different numbers, then add them up, and display the output of the sum and then display or print their total


Read more about programming here:

brainly.com/question/23275071

#SPJ1

5 0
1 year ago
How could the following line of code be shortened?
Alinara [238K]

Answer:

2

Explanation:

The second option is the only one that will work. The last would work but doesn't make the code any shorter.

8 0
2 years ago
Tiling is when a browser loads a background image and then repeats the image in both the vertical and horizontal directions unti
jeyben [28]
The correct answer is true
7 0
3 years ago
Read 2 more answers
Out of a list of the values 2, 45, 18, 22, 8, and 37, what result would the MAX function return?
Vika [28.1K]
37 most likely.
No programming language is specified, and you didn't put what the function is, so assuming it's already implemented, MAX should display the highest number.
8 0
3 years ago
Read 2 more answers
Ishmael would like to capture a selected potion of his screen and then capture action he performs on that selected portion. What
Natalija [7]

Answer: User the insert screen recording control

Explanation:

Since Ishmael wants to capture a selected potion of his screen l, after which he'll then capture the action that he performs on that selected portion, he should use the insert screen recording control.

It should be noted that on most keyboards, there's an "insert screen" button. Also, Ishmael can simply open the window that he wants to screenshot and then click the screenshot button.

Therefore, the correct option is B.

6 0
3 years ago
Other questions:
  • Personal Web Page Generator Write a program that asks the user for his or her name, then asks the user to enter a sentence that
    11·1 answer
  • Persons who have been given access to an installation can be counted on to be of no threat. true or false? (antiterrorism scenar
    13·1 answer
  • Wich is the last step in conducting a URL search
    14·2 answers
  • What does a data bar in a cell represents​
    12·2 answers
  • to add data to to a chart, you must format data from another microsoft office product, that automatically opens. whats the name
    10·1 answer
  • Andy wants to install a new Internet connection. He wants to take the fastest he can get. What are the maximum speeds for the fo
    9·1 answer
  • Use the ________ property in the html link tag to to associate a web page with a style sheet for printing.
    5·1 answer
  • He made me so angry when he didn’t let me make my point that I had to stalk after him.
    5·2 answers
  • How is your favorite singer and why I will give Brainliest
    10·2 answers
  • Customer history is an example of what
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!