Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in python Q2 Basic Data-Structures Implement the following lines of pseudocode in Python using basic data-structures syntax. This tests your understanding of: - Loops -

in python
image text in transcribed
image text in transcribed
Q2 Basic Data-Structures Implement the following lines of pseudocode in Python using basic data-structures syntax. This tests your understanding of: - Loops - Data-Structures [ ] \# create a list called "nums1" that contains the numbers 1 through 10 \# print out the first number in this list \# print out the last number in this list \# create a list called "nums2" that contains the numbers 5 through 15 \# convert "nums1" to a set and cal1 it "set1" \# convert "nums2" to a set and call it "set2" \# get the intersection of nums1 and nums2 and assign it to a variable called "inter \# print out "intersect" \# create a list called "nums 1 " that contains the numbers 1 through 10 \# print out the first number in this list \# print out the last number in this list \# create a list called "nums2" that contains the numbers 5 through 15 \# convert "nums1" to a set and cal1 it "set1" \# convert: "nums2" to a set and ca11 it "setz" " get the intersection of nums1 and nums2 and assign it to a variable called "intersect" 4. print out "intersect" H notice the dictionary below prices = \{"2022 Hyundal Sonata": 24,000, "2022. Toyota RAVA"; 32,900, "2022 Ford Explorer"; 35_609\} * print out the price of a "2022. Hyundal Sonata" using the dictionary If add the following key-value pair to the "prices" dictionary without recreating the dictionary \# "2022. Toyota Camry" : 27 . 600

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

More Books

Students also viewed these Databases questions