Discover how to work with sets in Julia, which are collections that contain only one instance of each value.
- [Instructor] Okay, continuing with our investigation … into Julia collection data structures, … we'll now take a look at sets. … So let's go ahead and open up sets_start in our editor. … A set is a collection of elements … that can be modified, just like arrays. … The two key differences between sets and arrays … is that one, sets can only have one of each element, … and two, sets are unordered. … The order of the elements is not important. … So to create a new set we can use the set constructor. … So let's go ahead and try that. … I'll say set1 is equal to Set. … And then I'll just print out the set. … All right, so let's go ahead and run what we have. … And when I run this file you can see that we have … an empty set of type Any, … which means we can put anything into it. … So let's go back to the code. … And in between these two statements … let's use the push function. … And remember, I'm using the exclamation point version, … which modifies one of the arguments. … So on set1 I'll add a string …
- Using the Julia REPL tool
- Differences between Julia and other languages
- Variables and data types
- Numbers in Julia
- Defining and operating on strings
- Using built-in functions in Julia
- Conditional statements
- Using array functions
- String processing
Skill Level Beginner
Python Basics for Java Developerswith Deepa Muralidhar42m 53s Beginner
Programming Foundations: Algorithmswith Joe Marini1h 45m Beginner
What you should know1m 26s
2. Language Basics
3. Language Features
4. Control Structures
5. Data Structures
6. Julia Features
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.