Write a python function called make_square that takes a tuple in the parameter as a range of numbers (starting point and ending point (included)). The function should return a dictionary with the numbers as keys and its squares as values.

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter8: Arrays
Section: Chapter Questions
Problem 2MQ4
icon
Related questions
Question

Write a python function called make_square that takes a tuple in the parameter as a range of numbers (starting point and ending point (included)). The function should return a dictionary with the numbers as keys and its squares as values.

Hints:
You need to declare a dictionary to store the result. You should use the range function to run the "for loop".
Example1:
Function Call:
make_square((1,3))
Output:
{1: 1, 2: 4, 3: 9}
Transcribed Image Text:Hints: You need to declare a dictionary to store the result. You should use the range function to run the "for loop". Example1: Function Call: make_square((1,3)) Output: {1: 1, 2: 4, 3: 9}
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Lists
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT