![]() ![]() |
| |||||||||
| Hotspots: Slides and Code TA Corner Comments? Announcements FAQ Static Webspace | ||||||||||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| Any guesses on (b)? What do the sample values represent – amplitude or frequency? s isn't a space – it's empty at the beginning. You can actually run these to test out your theories. Mark Guzdial |
s = 0? Karin Bowman
| When we say s="", it means that S is a string, but it's empty. len(s) would be 0. Mark Guzdial |
| len gives you the length of the input string. |
| Mark Guzdial |
| "==" is a test for equality. "=" is assignment. Just adding one just adds one. Some answers will be negative. Mark Guzdial |
| You're adding one while counting them, in the loop. You're subtracting them to get the total difference, after the loop. Mark Guzdial |