Basics Flashcards
1
Q
A
Prints a string into the console
print(‘Hello World’)
2
Q
Input
A
Prints a string into the console, and asks the user for a string input.
input(‘What’s your name?’)
3
Q
Comments
A
This is a comment
Adding a # symbol in front of text lets you make comments on a line of code. The computer will ignore your comments.
print(‘This is code’)
4
Q
Variables
A
A variable is like a box that contains a value.
my_name = ‘Jeffrey’
my_age = 24
5
Q
The += Operator
A
This is a convenient way of saying: “take the previous value and add to it”
my_age = 24
my_age += 4
my_age is now 28