CS 101 Lecture Notes - Lecture 4: Type Conversion, Substring, String Operations

26 views3 pages

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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents