Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using python and while loop only, Write code that takes two lists of integers from the user, and returns all possible pairs of integers between

Using python and while loop only,

Write code that takes two lists of integers from the user, and returns all possible pairs of integers between the two lists, without duplicates. In a pair, the smaller number must always come first. For example, if the lists were [1,2,3,4,5] and [2,3,4,5,6], your code would return the list of pairs ['1-2', '1-3', '1-4', '1-5', '1-6', '2-2', '2-3', '2-4', '2-5', '2-6', '3-3', '3-4', '3-5', '3-6', '4-4', '4-5', '4-6', '5-5', '5-6'].

Template,

def pairs(list1, list2): list1 = list1 list2 = list2 #YOUR CODE GOES HERE (indented) return [] #END YOUR CODE You may not use any built-in functions/methods besides len(), .append(), and str().

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Donald A. Carpenter Fred R. McFadden

1st Edition

8178088045, 978-8178088044

More Books

Students also viewed these Databases questions

Question

7. Set team as well as individual performance goals.

Answered: 1 week ago