Programming Notes Pt. 1

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

1/9

flashcard set

Earn XP

Last updated 9:04 PM on 2/6/23
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

10 Terms

1
New cards
What is the purpose of variables
To store values for later use
2
New cards
What are expressions? Provide an example
Code that yields a value when evaluated (20\*40, yields 800)
3
New cards
Comments
Helpful way to explain code to a reader
4
New cards
The value of a variable can be printed out via:
print(variable_name)
5
New cards
Reading input is achieved using the
input() function
6
New cards
A programmer can combine input() and int() to read in a string from the user and then convert that string to an integer by inputting
int(input())
7
New cards
strings
a sequence
8
New cards
What function can be used to find the length of a string ( and any other sequence type)
len()
9
New cards
How do we access substrings?
Use the Square brackets for slicing along with the index to obtain your substring

Ex: var1 = ‘Hello World!’

var2=”Python Programming”

print( “var1\[0\]:" , var1\[0\]
10
New cards
Python strings are “immutable” meaning
They cannot be changed after they are created