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
In honor of Black History Month, write an essay about a black person who has inspired YOU in some way. This person does not have
babymother [125]

Answer:

I will be talking about Jackie Robinson. Robinson was known for playing baseball with the Brooklyn Dodgers from 1947 to 1956, I will share a few of his other accomplishment.

In 1935, Robinson graduated from Washington Junior High School and enrolled at John Muir High School Recognizing his athletic talents, Robinson's older brothers Mack (himself, an accomplished athlete and silver medalist, at the 1936 Summer Olympics) and Frank inspired Jackie to pursue his interest in sports.

At Muir high school , Robinson played several sports , football, basketball, track, baseball and tennis. He played shortstop and catcher on the baseball team, quarterback on the football team, and guard on the basketball team. With the track and field squad, he won awards for the broad jump.

In 1936, Robinson won the junior boys singles championship at the annual Pacific Coast Negro Tennis Tournament.

He earned a place on the annual baseball tournament all-star team,

In late January 1937, the News newspaper reported that Robinson "for two years had been the outstanding athlete at John Muir, starring in football, basketball, track, baseball and tennis.

As Jackie was encouraged to move forward by his brothers Mack and Frank. Today, his accomplishments inspires me to keep moving forward.

Explanation:

3 0
3 years ago
A python keyword______.
Cerrena [4.2K]

Answer:

cannot be used outside of its intented purpose

Explanation: python keywords are special reserved words that have specific meanings and purposes and can't be used for anything but those specific purposes

8 0
3 years ago
How can I identify what is and what isn't an IP Address?
adelina 88 [10]

Answer:

you can identify an ip address in the bar where u type links

Explanation:

7 0
3 years ago
Write a program that prompts the user to input an integer and then outputs both the individual digits of the number and the sum
otez555 [7]

Answer:

Explanation:

#Using python to create the list

#first we create an empty list to store our numbers.

import math

data = []

x = 0

InputSum = 0

NumInput=int(input("how many number do you want to add"))

while x <=(NumInput):

   Input=int(input("Enter the numbers here"))

   data.append(Input)

   x = x+1

   InputSum = InputSum + Input  #this is to add the numbers entered

print("The number you entered are ")

print(*data)  #this print the numbers entered

print("The sum of the numbers is", InputSum)

3 0
3 years ago
Under what circumstances does a multithreaded solution using multiple kernel threads provide better performance than a single-th
pshichka [43]

The best scenario is when a program suffers from frequent page faults. In the situations when a kernel thread experiences a page fault, another kernel thread can be switched in; something a single-threaded process will not be capable of doing. Another best circumstance is when a program has to wait for other systems events.






5 0
3 years ago
Other questions:
  • To display or distribute information from a database, programmers or database administrators create ___ .
    12·1 answer
  • A layer of control in each communicating device that provides functions such as flow control, error detection, and error control
    13·1 answer
  • What kind of heat we feel from the sun
    15·2 answers
  • Write an algorithm to determine a students final grade and indicate whether it is passing or failing .the final grade is calcula
    12·1 answer
  • STEAM game launcher question.
    15·1 answer
  • All of the following are true of using the database approach to managing data except Group of answer choices Decentralized manag
    6·1 answer
  • Monster Collector
    7·1 answer
  • Denise found a volume of documents in the trash bin that contained individuals, names, social security numbers and years of birt
    14·1 answer
  • A programmer wants to determine whether a score is within 10 points of a given target. For example, if the target is 50, then th
    11·1 answer
  • A while loop is frequently used to ______________ data.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!