App development · lesson 15 of 24 · free

Data: variables, lists and saving — App development for students

Apps keep data. A variable is a named box for one value, like lives = 3. A list holds many values in order, like a list of notes; its positions start at 0, push adds an item at the end and pop takes the last one off. Data can be saved on the phone — private, fast and working offline, but lost with the phone — or in the cloud, where it can be shared and reached from any device but needs the internet.

▶ Watch how it works

Got it? Practise ↓

Developer's tip

Box, list, place — “a variable holds one value, a list holds many, and data is saved on the phone or in the cloud”

  1. A variable holds one value; a list holds many in order. Positions start at 0.
  2. push adds to the end; pop takes off the last item; length is how many items.
  3. On the phone: works offline, private. In the cloud: shared, any device, needs the internet.

Use it for: Deciding what your app must remember and where to keep it.

Worked example: 💾 What does this code show? (Positions start at 0.)
let notes = ["Hindi", "Music", "Sports", "Maths", "Science"];
show(notes[3]); → Maths

  1. Positions: 0 Hindi, 1 Music, 2 Sports, 3 Maths, 4 Science.
  2. notes[3] is the 4th item.

Check: notes.length is 5, and notes[0] is Hindi ✓

▶ Watch it animated

✏️ Practice

Work it out in your head or on paper, type the answer and press Check. Stuck? Press “Show me how”.

Right: 0 · Tried: 0

🏁 Lesson 15 test

20 questions. Check each answer, then go to the next one. Get 16 or more right to pass.

🏅 Sign in with Google to earn the 💾 Data Keeper badge when you pass — and a certificate when you finish all 8 lessons of Part 2 · Designing Apps. You can still take the test without signing in.

🖨️ App Dev Worksheet: Variables, Lists and Saving

✨ Free AI tutor

Ask the AI tutor about this lesson

Why does it work? When should you use it? Ask in English, मराठी or हिंदी.

Sign in with Google to ask Free — 20 questions a day.

👩‍🏫 App development classes near you — online or at home

Prefer a real teacher? TalentJR teachers take live online classes anywhere in India and visit homes in selected cities. Tell us what you need and our team will call you with timings and fees.

Live online classesSmall groups or 1:1 with a teacher, from home, any city.
Teacher at homeA TalentJR teacher visits your home (selected cities).
At a centreClasses at a TalentJR partner centre near you, where available.
Badges, certificates & gifts A badge for every lesson you pass, a certificate for every part you finish, plus TalentJR Points for daily practice. HTML, CSS & web development Build web pages with HTML, CSS and a little JavaScript.