Programming Notes Pt. 1

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 / 9

flashcard set

Earn XP

Description and Tags

10 Terms

1
What is the purpose of variables
To store values for later use
New cards
2
What are expressions? Provide an example
Code that yields a value when evaluated (20\*40, yields 800)
New cards
3
Comments
Helpful way to explain code to a reader
New cards
4
The value of a variable can be printed out via:
print(variable_name)
New cards
5
Reading input is achieved using the
input() function
New cards
6
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())
New cards
7
strings
a sequence
New cards
8
What function can be used to find the length of a string ( and any other sequence type)
len()
New cards
9
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\]
New cards
10
Python strings are “immutable” meaning
They cannot be changed after they are created
New cards

Explore top notes

note Note
studied byStudied by 16 people
838 days ago
5.0(1)
note Note
studied byStudied by 31 people
866 days ago
5.0(3)
note Note
studied byStudied by 7 people
854 days ago
5.0(1)
note Note
studied byStudied by 7 people
881 days ago
5.0(1)
note Note
studied byStudied by 313 people
321 days ago
5.0(2)
note Note
studied byStudied by 7 people
109 days ago
5.0(4)
note Note
studied byStudied by 172 people
533 days ago
5.0(1)
note Note
studied byStudied by 14 people
61 days ago
5.0(1)

Explore top flashcards

flashcards Flashcard (116)
studied byStudied by 2 people
97 days ago
5.0(1)
flashcards Flashcard (25)
studied byStudied by 7 people
822 days ago
4.5(2)
flashcards Flashcard (71)
studied byStudied by 1 person
697 days ago
5.0(1)
flashcards Flashcard (48)
studied byStudied by 7 people
105 days ago
5.0(1)
flashcards Flashcard (103)
studied byStudied by 40 people
485 days ago
5.0(1)
flashcards Flashcard (83)
studied byStudied by 2 people
649 days ago
5.0(2)
flashcards Flashcard (269)
studied byStudied by 8 people
590 days ago
5.0(3)
flashcards Flashcard (69)
studied byStudied by 36 people
21 days ago
5.0(1)
robot