2.2 programming fundamentals

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall with Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/12

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No study sessions yet.

13 Terms

1
New cards

What is a variable?

A named memory address that stores data which can be changed during program execution.

EX: age = 34

2
New cards

What are the two different types of variable?

  • Global

  • Local

3
New cards

What is a constant?

A named memory address that stores data which cannot be changed during program execution.

EX: PI = 3.14

4
New cards

What function is used in python to obtain user input?

input()

EX: age = input(“What is your age?”)

5
New cards

What function is used in python to display output?

print()

EX: print(“Hello World!”)

6
New cards

What is an f-string?

A formatted string used to embed variables into text.

EX: print(f"You are {age} years old.”)

7
New cards

What are the three key programming constructs?

  • Sequence

  • Selection

  • Iteration (count- and condition-controlled)

8
New cards

What is sequence?

A programming construct where each line of code is executed one after another.

9
New cards

What is selection?

A programming construct where different paths are chosen based off of whether a condition is true or false.

10
New cards

What is iteration?

A programming construct where a section of code is repeated while a condition is true (condition-controlled) or for a predetermined number of times (count-controlled).

11
New cards

What are some common comparison and arithmetic operators?

knowt flashcard image
12
New cards

What are the main data types?

  • Integer

  • Real

  • Boolean

  • Character

  • String

13
New cards

What is casting?

The conversion of the value of a variable from one data type to another.

EX: age = int(input(“What is your age?”)

Explore top flashcards