CoCalc Public Files1 / 6 / Lab1_SageMath_Variables.ipynbOpen with one click!
Authors: ANGEL MORE, Kristin McCully
Compute Environment: Ubuntu 20.04 (Default)
In [1]:
#Exercise 1 3
3
In [2]:
#Exercise 2 1775
1775
In [4]:
#Exercise 3 2*2
4
In [5]:
#Exercise 4 10/4
5/2
In [6]:
#Exercise 5 1775/6
1775/6
In [7]:
#Exercise 6 1775/6.0
295.833333333333
In [8]:
#Exercise 7 (2.5^6)
244.140625000000
In [9]:
#Exercise 8 mice = 3 mice
3
In [10]:
#Exercise 9 prod = 7*94 prod
658
In [11]:
#Exercise 10 - a is a variable that is assigned to the value 2*26. b is a variable that is assigned to the value 29*12. val is assigned to the value of a*b. the value of val is printed.
In [17]:
#Exercise 11 a = 67*45 b = 93*442 ab = a + b ab
44121
In [18]:
#Exercise 12 k = 76.2 + 35.1 sqrt(k)
10.5498815159223
In [19]:
#Exercise 13 bignum = mice^20 bignum
3486784401
In [16]:
#Exercise 14 - the value of dalmation in the first line is asssigned to 100
In [20]:
#Exercise 15 - the line dalmation=dalmation+1 will add 1 to orginal value of dalmation which is 100, so now the the value of dalmation is 101
In [21]:
#Exercise 16 num = 5 num = num + 2 num
7
In [23]:
#Exercise 17 sqrt(37.0)
6.08276253029822
In [24]:
#Exercise 18 ln(27.5)
3.31418600467253
In [26]:
#Exercise 19 sqrt(abs(625-810.0))
13.6014705087354
In [27]:
#Exercise 20 sqrt(ln(5^8.7))
3.74193931513816
In [31]:
#Exercise 21, part 1 number = 625-810.0 absolute = abs(number) sqrt(absolute)
13.6014705087354
In [30]:
#Exercise 21, part 2 number1 = 5^8.7 logof10 = ln(5^8.7) sqrt(logof10)
3.74193931513816
In [32]:
#Exercise 22 abs = -2
In [33]:
#Exercise 23 ln(35.0)
3.55534806148941
In [34]:
#Exercise 24 plot(sqrt(x), (x,0,1000))
In [1]:
#Exercise 25 plot(abs(x),(x,-10,10))
In [1]:
#Exercise 26 plot(5*x^4, (x,-2,2), color = "green")
In [6]:
#Exercise 27 plot(x, (x, -1, 1), color = "pink") + plot(x^50, (x, -1, 1), color = "purple")
In [ ]:
In [ ]: