Class 10 – Wednesday, February 6

Being loopy

Being random for a loop

You did not expect – The repetition to come – You did not expect


Look both ways


Agenda


Examples

Enter three numbers: 1112 12 1

[4, 1, 4, 0, 6, 1, 5, 2, 5, 1, 1, 2]

4

Enter three numbers: 8 9 6

[3, 5, 6, 2, 3, 0, 1, 2, 3]

1

  • Prompts and gets as input an integer list of numbers
  • Converts the input into a list of numeric strings
  • By accumulation, converts the numeric strings one-by-one to get a list of integers (a loop is needed)
  • By accumulation, gets the total of the integer list values one-by-one (a loop is needed)
  • Prints the integer list
  • Prints the total

Enter a list of integers: 3 5 9 13

[3, 5, 9, 13]

30

Enter a list of integers: 2 -7 9 88

[2, -7, 9, 88]

92


To do list


Proof dogs are not as smart as they think they are

csi dog