CS 101 Lecture Notes - Lecture 4: Type Conversion, Substring, String Operations
Document Summary
Cs 101 lecture 4 string formatting and functions. Make sure to register your i>clickers on the course compass page attendance counts from today! Homework #2 is due friday sep. 9. No lab the week of labor day. Warmup quiz: x = 3 , y = 10 % 4, print(x * y: what does this program print? (33) C = (10 + 5j), i = 25, r = c. real + i: what is the type and value of r? (float, 35. 0, because c. real gives a float, not an integer. ) Which is most likely to cause an overflow: 10 ** 100000, 10 * 10000, 10. 0 ** 100000, 10 ** 100000? (10. 0 ** 100000: floats are more likely to cause an overflow, python cannot represent extremely large or extremely small quantities (overflow/underflow) X = 10 , y = %i , print( (x+y) % 2: what is printed? (102, remember that operators work differently with different data types.