πΏ Lists
Anonymous contributor
Published Aug 4, 2021Updated Sep 9, 2021
Contribute to Docs
A list literal is a listing of expressions.
Lists are always ordered and can contain different types of objects, such as strings, integers, booleans, etc. Lists are a mutable data type and therefore a good choice for dynamic data (adding and subtracting to lists).
Syntax
In Emojicode, a list is created by using πΏ and π.
For instance, the example below is a list literal with integer values 18
, 67
, 420
.
πΏ 18 67 420 π
Hereβs another list with three strings:
πΏ π€eggsπ€ π€blueberriesπ€ π€cookiesπ€ π
The compiler will try to infer the type of a list literal. The default type of list literals, is the list type π¨, an ordered mutable collections of values.
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.
Learn Emojicode on Codecademy
- Career path
Computer Science
Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!Includes 6 CoursesWith Professional CertificationBeginner Friendly75 hours - Free course
Learn Emojicode
π Learn about Emojicode, a programming language that consists of emojis! πBeginner Friendly1 hour