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
skad [1K]
3 years ago
6

. Write a short Python function that takes a sequence of integer values and determines if there is a distinct pair of numbers in

the sequence whose product is odd. (1 Point)
Computers and Technology
1 answer:
lisov135 [29]3 years ago
6 0

Answer:

Explanation:

The following code is written in Python and like requested takes a function called odd_number that takes a list of integers as a parameter. It then loops through the list two times, each time calculating the product of the two numbers and returning Yes if the product is an odd number while also including the two numbers from the list that make that product. If there is no odd product in the list the function simply returns No

def odd_product(my_list):

   for num1 in range(len(my_list)):

       for num2 in range(len(my_list)):

           if num1 == num2:

               pass

           else:

               product = my_list.__getitem__(num1) * my_list.__getitem__(num2)

               if (product % 2) != 0:

                   return "Yes, " + str(my_list.__getitem__(num1)) + " and " + str(my_list.__getitem__(num2))

   return "No"

You might be interested in
A DSS8440 server is equipped with one power supply that is failing and requires replacement. What is the correct sequence of ste
Alisiya [41]

Answer:

ICICI oxidized sicken o'clock o'clock succinct

6 0
2 years ago
Which IEEE standards define Wi-Fi technology?
Ratling [72]

Answer:

802.11 standards

4 0
4 years ago
Which of the following is used to allocate memory for the instance variables of an object of a class?1. the reserved word public
kodGreya [7K]

Answer:

The correct answer to the following question will be 2. the operator new.

Explanation:

New operator is used to allocating the memory to the instance object.The new object can be created by using a "new" keyword in java .

Syntax of using 'new' operator is :

class_name object_name=new class_name() // it allocated the memory to the class

For Example :

ABC obj = new ABC;  

Now, this time obj points to the object of the ABC class.

obj = new ABC ();

call the construction of ABC class

3 0
3 years ago
Read three integers from user input without a prompt. Then, print the product of those integers. Ex: If input is 2 3 5, output i
trapecia [35]

Answer:

num1=2

num2=3

num3=5

num1= int(num1)

num2= int(num2)

num3= int(num3)

pro = num1*num2*num3

print(pro)

Explanation:

This is very close to a correct answer in easy code and easy to read, I was not able to put the answer in without the proper indentation alignment the way I would present this. So please adjust to your requirements for the indentation.

3 0
2 years ago
Select the correct answer.
aliina [53]

Answer:

B

Explanation:

engineers design and carry out test cases and evaluate exit criteria (by following the scope set in the planning phase). They create bug reports describing detected defects and report to the stakeholders on the test findings and the completion status. Testing may be repeated to check for errors.

7 0
3 years ago
Other questions:
  • What seems to be the prevailing opinion about enterprise clouds?
    8·2 answers
  • What has the dogo argentino been bred to do?​
    12·1 answer
  • Television has greatly influenced how politicians are perceived via the sound bite and ________ campaigning.
    11·1 answer
  • P**nhub or x-videos or other
    9·1 answer
  • Titus would like to make his products stand out a little more in his Excel spreadsheet. What actions would help to distinguish o
    15·1 answer
  • Disadvantages of Batch<br>operation system​
    5·1 answer
  • A teacher wants to check the typing proficiency of five students. She gives all of them the same passage to type. Which student
    11·1 answer
  • What is a benefit of using a client/server network?
    7·1 answer
  • Example of vector image format​
    12·1 answer
  • 4.8.4 Better Sum
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!