CS 1110 Lecture Notes - Lecture 7: Negative Number
Document Summary
9/12/18: spaces are just as important as any letter. Input must look like an integer: changes character values to actual integers rather than just variables num1 = int(input("please enter an integer: ")) => please enter an integer: 1. # string input coerced to int num2 = int(input("please enter another integer: ")) => please enter another integer: 2 print(num1 + num2) => 3 (sum rather than concatenation) If (cid:272)ou(cid:374)t(cid:1005) is (cid:1006), the(cid:374) evaluates the e(cid:454)p(cid:396)essio(cid:374) to (cid:1007) so the(cid:374) (cid:272)ou(cid:374)t(cid:1005) (cid:272)ha(cid:374)ges to.