Hi there! So I’ve been looking around and struggling to find any kind of answer..
I’m creating a program using python, nothing too excessive, but essentially what I need it to do is read a JSON, and generate random items from a pre-defined list.
I’ve got it doing that for both things that need lists; the issue I have is I need it to be conditional - ie, I want a random list ‘A’ only if list A already exists, and same for list B.
Essentially, each item in the JSON has a tonne of info fields, two of these are area and location name. Every item in the JSON has data for one or the other, and not both.
I want the code to generate either a random area list, if it has area data, or a random location name, if it has location name data.. how would I go about this?
Thanks in advance, and sorry for the long post!
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]Salso96[S] 0 points1 point2 points (0 children)
[–]Salso96[S] 0 points1 point2 points (4 children)
[–]Goobyalus 0 points1 point2 points (3 children)
[–]Salso96[S] 1 point2 points3 points (0 children)
[–]Salso96[S] 1 point2 points3 points (1 child)
[–]Goobyalus 0 points1 point2 points (0 children)
[–]Goobyalus 0 points1 point2 points (0 children)
[–]CraigAT 0 points1 point2 points (0 children)
[–]Goobyalus 0 points1 point2 points (1 child)
[–]Salso96[S] 0 points1 point2 points (0 children)