deck 1 Flashcards
what are strings
are sequences of characters enclosed in single or double quotes
you can preform various operations on strings such as slicing and concatenation
wat can you assign to variables
value
what types of data can variables hold
numbers, strings or lists
what are lists
collections of data in a single order
what can you do to lists
add, remove or modify items within them
what are loops
they are used to repeat blocks of code
what are the two different types of loops
for loops and while loops
what are if statements used for
to make decisions in code
what are functions
blocks of reusable code
how are function blocks defined
using the def keyword
what is a random module
generates random numbers or choices
what are some common python errors
syntax errors
indentation error
what happens when you add lists together
they simply go next to each other like
[1,2,3] + [4,5,6]
is
[1,2,3,4,5,6]
what does a try-except block do
its used to catch and handle exceptions or errors without stopping the program
what does [0] mean
the first character of a string