Basics Flashcards

1
Q

Print

A

Prints a string into the console

print(‘Hello World’)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Input

A

Prints a string into the console, and asks the user for a string input.

input(‘What’s your name?’)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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’)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Variables

A

A variable is like a box that contains a value.

my_name = ‘Jeffrey’
my_age = 24

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly