LIFESCI 30A Quiz: Lab Notes
Document Summary
Type a number, sage will spit it back. Need * for functions such as 2x -> 2*n. To get an output with decimal, put a decimal point in it. Give a value a label = assign value to the variable // mice = 3 // a = 1 , b= Functions can be combined to make other functions. Basic plotting syntax plot(f(x), (x, xmin, xmax), color= red) Assigning a plot to a variable saves a graphics object that can be viewed later. Interactive -- using slider to change slope values. @ interact def slopeline (m=(-10,10, . 5)): p=plot(m*x, (x, -5, 5), ymin= -50, ymax=50) show (p) Strings can include letters and numbers but when they"re numbers they act differently. If you add two numbers in strings, they will combine, not add. First element will be items[0] which is item not item 1. Add an element to the end of the list using listname. append (element)