Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program in Python to solve these problems. ( not required but if possible, Run your code in Googles Colab platform ). 1. Assuming
Write a program in Python to solve these problems.
1. Assuming that variables a,b,c,d, and f are scalars, write Python statements to compute and display the following expressions. Test your statements for the following values. a=1.12,b=2.34,c=0.72,d=0.81,f=19.83 Correct Answer x=1+ba+f2cs=dcbar=a1+b1+c1+d11y=abc12f2 2. Evaluate the following expressions in Python. x=5+8iy=6+7i a) u=x+y b) v=xy c) w=x/y d) z=ex Correct Answer e) r=y f) s=xy2 3. Use Python to compute the following expressions. a) (3+6i)(79i) Correct Answer b) 54i5+4i c) 2i3 4. Use Python NumPy to calculate the following expressions. Check your answers with a calculator. The log specified in this problem means log to the base 10. a) e(272+3.47log(14)+4287 b) (3.4)7log(14)+4287 c) cos2(64.12) Correct Answer d) cos(64.12)2 5. Suppose that x=6. Find the results of the following operations by hand and use Python to check your results. a) z=(x=4) d) z=(x=7) Correct Answer 6. Find the results of the following operations by hand and use Python to check your results. a) z=6>3+8 b) z=6+3>8 c) z=4>(2+9) d) z=(4=5 Correct Answer 7. Suppose string ' A ' is defined in a Python program as follows. A - 'Data science professionals have promising career path' Compute the following expressions. a. A[B] b. A[1] c. A[6] d. A[3:10] e. "promising" in A. f. A. lower () + replace ('career path', future') . Isteip(' ' ) 9. A. Index( "seience') Correct Answer a=t b=t c=r d=a scien e= True f= ata science professionals have pronising future g=5 8. Suppose in a Python program the following variables are defined. x=3y=14z=15+6iintegeristringAstring Compute the following expression: (tr(X)+Y+Z) Correct Answer 9. Suppose in a Python program the following variables are defined. X=$56, \#string Y=,23.5 estring Compute; Z=str(int(X)+float(Y)) Correct ( not required but if possible, Run your code in Googles Colab platform ).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started