From the course: Scripting for Testers
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Challenge: Find duplicate URLs - Python Tutorial
From the course: Scripting for Testers
Challenge: Find duplicate URLs
(intensifying swooshes) - [Instructor] Okay, so now it's time to try this out on your own. You've learned a little bit about how to interact with the REST API, so now let's see if you can use that power to find out some interesting information. This challenge will use data from the JSONPlaceholder site that we've looked at before, and your challenge will be to see if you can find any photos that use duplicate URLs. So if we take a look at this data set, we can see that each photo has a URL associated with it, and in this challenge, we want to go through and see if there are two or more photos that are referencing the same URL. Don't worry too much about what particular photos are pointing to the same URLs. All we want to know is if there are any instances of this happening in this data set. One hint in doing this in Python is that if you have a list of items that has duplicates in it, and you turn that list into a set, the set operation will remove all the duplicates from the list. So…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.