PROGRAMMING

  minte9
learningjourney




S R Q

Variables

1 p33 In programming an assignment creates a variable and gives it value.
 
""" Variables
An assignment creates a variable and gives it value
You can assign multiple variables in one line
"""

message = 'Hello World'
print(message) # Hello World

n = 17
n = n + 24
print(n) # 41

a, b, c = [1, 2, 3] # Look Here
assert a == 1
assert b == 2
assert c == 3

Statements

1 p36 A statement is a unit of code that has an effect.
 
""" Statements
When you type a statement, 
the interpreter executes it
"""

n = 17    # statement 1
print(n)  # statement 2

Operators

1 p39 The + operator concatenates two strings.
 
""" Operators
The + operator concatenates two strings
The * operator performs repetitions on strings
"""

a = 'Hello'
b = 'World'

print(a + ' ' + b) # Hello World
print(a*3) # HelloHelloHello

Questions    
Last update: 69 days ago