Hacks #1

Num1 = 50 
Num2 = Num1 % 9 + 15 # MOD comes before addition. 50 divided 9 is 5 remainder 5 since MOD only takes the value of the remainder, it will now be 5 + 15 which will make Num2 = 20
Num3 = Num2 / Num1 + ( Num2 * 2 ) # Parenthesis come first. Num2 equals 20. 20 times 2 equals 40. Next operation will be division. Num2, 20, divided by Num1, 50 is 0.4. Next is addition. 0.4 + 40 is 40.4. So Num3 = 40.4
Num4 = Num3 + Num1 / 5 - 10 # Division comes first. Num1 equals 50, so 50 divided by 5 is 10. Next is addition and subtraction. Num3 is 40.4. 40.4 + 10 - 10 is 40.4. So Num4 = 40.4
Result = Num4 - Num2 # Num4 equals 40.4 and Num2 equals 20. 40.4 - 20 is 20.4. So Result = 20.4
print(Result)

Result = 20.4

Num1 = 10
Num2 = Num1 % 3 * 4 # Num1 equals 10. MOD and multiplication go from left to right. 10 divided by 3 is 3 remainder 1 since MOD only takes the value of the remainder, it will now be 1 * 4 which will make Num2 = 4
Num1 = Num2 # The value of Num2, 4, will now be the value of Num1. Num1 = 4
Num3 = Num1 * 3 # The value of Num1 is now 4. 4 * 3 is 12. Num3 = 12
Result = Num3 % 2 # The value of Num3 is 12. 12 divided by 2 is 6 remainder 0. MOD only takes the value of the remainder. Result = 0
print(Result)

Result = 0

valueA = 4
valueB = 90
valueC = 17
valueB = valueC - valueA # valueC = 17 and valueA = 4. 17 - 4 is 13. The result is being assigned as the new value of valueB, so valueB is now 13.
valueA = valueA * 10 # valueA is 4. 4 * 10 is 40. The result is being assigned as the new value of valueA, so valueA is now 40
if valueB > 10: # valueB is now 13. 13 is greater than 10. So it will print valueC, which is 17.
    print(valueC)

17

type = "curly" # initial value of variable "type"
color = "brown"
length = "short"
type = "straight" # value of variable "type" is now "straight"
hair = type + color + length # the addition of these non integer values will just concatenate the variables, so print will output "straightbrownshort"
print(hair)

straightbrownshort

Hacks #2

Noun = "Mr. Mortenson" 
Adjective = "handsome" 
Adjective2 = "very" 
Verb = "is" 
abrev = Noun[0:13] 
yoda = (abrev + " " + Verb + " " + Adjective2 + " " + Adjective + ".") 
print(yoda)
Mr. Mortenson is very handsome.
cookie = "choclate" # 8 characters in the incorrectly spelled word "choclate"
cookie2 = "rasin" # 5 characters in the incorrectly spelled word "raisin"
len1 = len(cookie) / 2 # there are 8 characters in "choclate", so len(cookie) = 8. 8 divided by 2 is 4 so len1 equals 4
len2 = len(cookie2) * 45 # there are 6 characters in "rasin", so len(cookie2) = 5. 5 times 45 is 225 so len2 equals 225
vote1 = str(cookie) + "vote" + str(len2) # I think they want to concatenate these together. The value of cookie is "choclate" and len2 is 225. So vote1 is assigned "choclatevote225" (no space in between)
vote2 = str(cookie2) + "vote" + str(len1) # I think they want to concatenate these together. The value of cookie2 is "rasin" and len1 is 4. So vote1 is assigned "rasinvote4" (no space in between)
votes = str(vote1) + " " + str(vote2) # concatenate vote1 and vote2 to get "choclatevote225 rasinvote4"
print(votes) # vote will be displayed as "choclatevote225 rasinvote4"
choclatevote225 rasinvote4.0