Basic Programming Concepts

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/21

flashcard set

Earn XP

Description and Tags

These flashcards cover key programming concepts including variables, data types, data structures, and important functions.

Last updated 3:30 PM on 4/14/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

22 Terms

1
New cards

Variable

A named location used to store data in a program. It allows programmers to reuse and update values throughout the code. For example, x = 10 stores the value 10 in a variable.

2
New cards

Data types

Different kinds of data used in programming, such as integers, strings, and Booleans. For example, 5 is an integer, "hello" is a string, and True is a Boolean.

3
New cards

String

A sequence of characters enclosed in quotes, used to store text data. For example, "Yasmine" is a string.

4
New cards

Integer

A whole number without decimals, used for counting and numeric calculations. For example, 10 is an integer.

5
New cards

Boolean

A data type that can only be true or false, used to represent conditions in programming. For example, 3 < 5 evaluates to True.

6
New cards

Type conversion

Changing data from one type to another, often to ensure compatible types for operations. For example, converting "5" to 5 allows mathematical calculations.

7
New cards

List

An ordered collection of items stored in a single variable. It is used to store multiple values together. For example, [1, 2, 3] is a list of numbers.

8
New cards

Indexing

Accessing elements in a list using their position. It allows retrieval of specific items. For example, list[0] returns the first element.

9
New cards

Slicing

Extracting a portion of a list or string by accessing a range of elements. For example, list[1:3] returns elements from index 1 to 2.

10
New cards

Dictionary

A data structure that stores data as key-value pairs. It allows data to be accessed using keys instead of positions. For example, {"name": "Yasmine"} stores a labeled value.

11
New cards

Key-value pair

A key-value pair consists of a key linked to a value. It is used in dictionaries to organize data. For example, "age": 20 connects a key to its value.

12
New cards

Mutable data

Data that can be changed after creation, such as lists. You can modify a list.

13
New cards

Immutable data

Data that cannot be changed after creation, such as strings.

14
New cards

Updating a variable

A variable is updated by assigning it a new value. This replaces the old value stored in it. For example, x = x + 1 increases the value of x.

15
New cards

Storing data

Saving values for later use. For example, saving a number

16
New cards

Computing data

Performing operations on data. For example, calculating the values for its sum

17
New cards

Data structures

Organize and store data efficiently to make access and manipulation easier. For example, lists and dictionaries help manage collections of data.

18
New cards

Difference between a list and dictionary

A list stores data in an ordered sequence, while a dictionary stores data as key-value pairs.Lists use indexing, while dictionaries use keys. For example, lists use positions, dictionaries use labels.

19
New cards

len() function

The len() function returns the number of items in a collection. It is used to measure the size of data structures. For example, len([1,2,3]) returns 3.

20
New cards

sum() function

The sum() function adds all numeric elements in a collection. It is used for quick calculations. For example, sum([1,2,3]) returns 6.

21
New cards

sort() function

The sort() function arranges elements in a list in order. It is used to organize data. For example, [3,1,2].sort() changes the list to [1,2,3].

22
New cards

Importance of data structures

Allow efficient data storage and access, making programs more organized and scalable. For example, using lists or dictionaries improves performance and readability.