CoCalc Public FilesLab 1 / Lab1-turnin.ipynbOpen with one click!
Author: Valerie Doan
Views : 37
Compute Environment: Ubuntu 20.04 (Default)
In [1]:
# Name:Valerie Doan # I worked on this code with: Abigail, Sophia, and Vanessa # Please do all of your work for this week's lab in this worksheet. If # you wish to create other worksheets for scratch work, you can, but # this is the one that will be graded. You do not need to do anything # to turn in your lab. It will be collected by your TA at the beginning # of (or right before) next week’s lab. # Be sure to clearly label which question you are answering as you go and to # use enough comments that you and the grader can understand your code.
In [1]:
#1 3
3
In [2]:
#2 1775
1775
In [3]:
#3 2*2
4
In [4]:
#4 10/4
5/2
In [5]:
#5 1775/6
1775/6
In [6]:
#6 1775/6.
295.833333333333
In [7]:
#7 2.5^6
244.140625000000
In [9]:
#8 mice=3 mice
3
In [10]:
#9 prod=7*94 prod
658
In [ ]:
#10 #the function 2*26 is assigned to the variable a #the function 12*29 is assigned to the variable b #the function a*b is assigned to the variable val #val is called on so the numerical value can be displayed
In [11]:
#11 a=67*45 b=93*442 sum=a+b sum
44121
In [22]:
#12 sq=sqrt(76.2+35.1) sq
10.5498815159223
In [16]:
#13 bignum=mice^20 bignum
3486784401
In [17]:
#14 100
100
In [ ]:
#15 #The line dalmations=dalmations + 1 adds the 1 to the previous value of the dalmations variable
In [18]:
#16 num=5 num=num+2 num
7
In [24]:
#17 sqrt(37.)
6.08276253029822
In [26]:
#18 ln(27.5)
3.31418600467253
In [29]:
#19 sqrt(abs(625.-810.))
13.6014705087354
In [31]:
#20 sqrt(ln(5.^8.7))
3.74193931513816
In [34]:
#21 c=abs(625-810.) d=sqrt(c) d e=ln(5.^8.7) f=sqrt(e) f
13.6014705087354
In [36]:
#22 abs=-2 g=abs(abs)
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-36-808ab59b5443> in <module>() 1 #23 2 abs=-Integer(2) ----> 3 g=abs(abs) TypeError: 'sage.rings.integer.Integer' object is not callable
In [2]:
#23 ln(35.0)
3.55534806148941
In [4]:
#24 plot(sqrt(x), (x,0,1000))
In [5]:
#25 plot(abs(x), (x,-10,10))
In [6]:
#26 plot(5*x^4, (x,-2,2), color="green")
In [10]:
#27 plot(x^3, (x,-5,5), color="pink") + plot(2*x^2, (x, -5, 5), color="purple")