Class 4 – Wednesday, January 23

Variation on a theme

A variable — Is like a box or a name — We must all know this

That Black Lives Matter — Should be so easy to grasp — People are people


Look both ways


Agenda


Please help us help you


Important questions


Problems of the day

What the solution offers

Basic understanding of variables and assignment.


What the solution offers

  • The ability to update is crucial when problem solving.

What the solution offers

  • Examines some nuances of the assignment operator.
  • The final version of the program updates the value of variables in terms of themselves; ie., number of rabbits doubles each generation and the generation number is an increment of the previous generation value.

Problem

  • Prompt and get what is on the user’s mind
  • Echo (print) the reply
  • Prompt and get why the first reply is on their mind.
  • Prints Oh!

What the solution offers

  • Introduces the str type operator +. The + operator when evaluated with two strings as its operands, produces as its value, their concatenation.
  • Also introduces built-in function input(). When the function is invoked, its argument is printed to the display, the entry supplied by the user in response to that message is the value of the invocation. The input() function always returns the user reply as a string.
  • The input() function allows programs to be interactive; i.e., their actions can be influenced by the user. The input() function enables Python to do general problem solving.
  • The final version of the program reflects echoing of the first input before printing the second prompt

What the solution offers

  • Uses the built-in cast functions int() and float() to convert numeric strings into the numbers they represent.
  • The final version of the program shows the two casts using built-in functions int() and float() to convert the supplied string-based inputs into numerics.

To do list




rabbits galore