Conditional statements; for AND while loops; screen input and output; debugging; Python arithmetic; four data types

studied byStudied by 0 people
0.0(0)
learn
LearnA personalized and smart learning plan
exam
Practice TestTake a test on your terms and definitions
spaced repetition
Spaced RepetitionScientifically backed study method
heart puzzle
Matching GameHow quick can you match all your cards?
flashcards
FlashcardsStudy terms and definitions

1 / 27

encourage image

There's no tags or description

Looks like no one added any tags here yet for you.

28 Terms

1

for i in range(#,#):

A loop structure that allows the execution of a block of code a specific number of times.

New cards
2

Output of 'for i in range(6): print(i)'

0, 1, 2, 3, 4, 5

New cards
3

for i in range(1,7): print(i)

This prints numbers starting from 1 up to 6, resulting in: 1, 2, 3, 4, 5, 6.

New cards
4

for i in range(10,41,5)

This prints numbers starting from 10 to 40, counting by fives: 10, 15, 20, 25, 30, 35, 40.

New cards
5

str

A variable type that holds a string or text.

New cards
6

int

A variable type that represents an integer (whole) number.

New cards
7

float

A variable type that represents a decimal number.

New cards
8

bool

A variable type that represents a boolean value, either True or False.

New cards
9

X = True

An example of a boolean variable assignment in Python.

New cards
10

Python Variables

Names that can only include letters, numbers, and underscores, cannot start with a number.

New cards
11

Reserved Words in Python

Keywords like while, in, and else that cannot be used as variable names.

New cards
12

Case-sensitive names

Variable names in Python are case-sensitive, meaning 'var' and 'Var' are different.

New cards
13

Variable Naming Convention

It is recommended to use lowercase letters and underscores for variable names.

New cards
14

int(input(“____________”))

Usage of input function to get an integer from the user.

New cards
15

if something is true:

print(________)

A conditional statement to execute code if a certain condition is met.

New cards
16

elif something is true: print(________)

An additional conditional statement that checks another condition if the previous is false.

New cards
17

else: print(________)

A fallback option that executes if none of the previous conditions are true.

New cards
18

** in Python

The operator used to calculate exponents.

New cards
19

*in Python

The operator used for multiplication.

New cards
20

/ in Python

The operator used for division.

New cards
21

% in Python

The operator that gives the remainder of division.

New cards
22

// in Python

The operator that rounds down the result of division.

New cards
23

-in Python

The operator used for subtraction.

New cards
24

+in Python

The operator used for addition.

New cards
25

print(i)

A function used to display output or values in Python.

New cards
26

range(start, stop)

A built-in function that generates a sequence of numbers from start to stop, not including stop.

New cards
27

range(start, stop, step)

A built-in function that generates numbers from start to stop, increasing by step.

New cards
28

Counting with 'for' loops

'for' loops are commonly used for iterating over a range of numbers in Python.

New cards

Explore top notes

note Note
studied byStudied by 102 people
1036 days ago
5.0(3)
note Note
studied byStudied by 7 people
893 days ago
5.0(1)
note Note
studied byStudied by 18 people
841 days ago
5.0(1)
note Note
studied byStudied by 9 people
874 days ago
5.0(1)
note Note
studied byStudied by 7 people
99 days ago
5.0(1)
note Note
studied byStudied by 156 people
374 days ago
5.0(1)

Explore top flashcards

flashcards Flashcard (30)
studied byStudied by 28 people
325 days ago
5.0(1)
flashcards Flashcard (27)
studied byStudied by 7 people
402 days ago
5.0(1)
flashcards Flashcard (120)
studied byStudied by 1 person
110 days ago
5.0(1)
flashcards Flashcard (31)
studied byStudied by 59 people
341 days ago
5.0(1)
flashcards Flashcard (65)
studied byStudied by 3 people
775 days ago
5.0(2)
flashcards Flashcard (115)
studied byStudied by 1109 people
406 days ago
5.0(2)
flashcards Flashcard (64)
studied byStudied by 14 people
754 days ago
4.0(1)
flashcards Flashcard (46)
studied byStudied by 3 people
1 day ago
5.0(2)
robot