Python3 my struggle


#1

Started the Python3 and went to pro after completing the first part. It got hella hard. I feel like the += thing was just kinda glossed over and the next exercise is all about it. I tried customer_one_total += customer_one_itemization += sales_tax. Made a great big syntax error all over the floor. I feel like ive been bait and switched.


#3

I think you have one = sign too many. Try:

customer_one_total += customer_one_itemization + sales_tax

Good luck!


#4

Search for python assignment operators to get the complete picture. Most basic arithmetic operations can be written in this way to save typing and repetition.

a = a + 5

becomes,

a += 5

When ever we increase a value by some amount, we are said to augment that value. Multiplication, addition and exponentiation (exponents greater than 1) all increase the value upon which they are applied.

a = 7
a *= 6
print (a)    # 42

a **= 2
print (a)    # 49

Each of the above can be called augmentation operators but the key is to see that two operations are being carried out, not one. First the math is done, then the assignment back onto the variable.

As with this particular expression,

customer_one_total += customer_one_itemization + sales_tax

note that any expression that can be assigned, can also be used in this operation.

a = a + 3 * (b + c + d)  =>  a += 3 * (b + c + d)

#6

also can my username not be my name?


#7

Your username is set when you join CC and it stays the same over here. Your real name is visible by clicking on your alias in any post.


#8

Eh i guess thats fine.