main.py 01 k = # hardcode your test data here2 x - float (x)3 # write your code here4 print("y -", y)Remember that classical algebraic notation likes to omit themultiplication operator - you...


Test Data<br>Objectives<br>• Familiarize with the concept of numbers, operators, and<br>arithmetic operations;<br>Sample input<br>x = e<br>x = 1<br>x = -1<br>• Able to perform basic calculations.<br>Scenario<br>Expected Output<br>Take a look at the code in the editor: it reads a float value, puts<br>y = -1.0<br>y = 3.0<br>y = -9.0<br>it into a variable named x, and prints the value of a variable<br>named y. Your task is to complete the code in order to evaluate<br>the following expression:<br>3x2 - 2x2 + 3x - 1<br>The result should be assigned to y.<br>< > main.py 0<br>1 k = # hardcode your test data here<br>2 x - float (x)<br>3 # write your code here<br>4 print(

Extracted text: Test Data Objectives • Familiarize with the concept of numbers, operators, and arithmetic operations; Sample input x = e x = 1 x = -1 • Able to perform basic calculations. Scenario Expected Output Take a look at the code in the editor: it reads a float value, puts y = -1.0 y = 3.0 y = -9.0 it into a variable named x, and prints the value of a variable named y. Your task is to complete the code in order to evaluate the following expression: 3x2 - 2x2 + 3x - 1 The result should be assigned to y. <> main.py 0 1 k = # hardcode your test data here 2 x - float (x) 3 # write your code here 4 print("y -", y) Remember that classical algebraic notation likes to omit the multiplication operator - you need to use it explicitly. Note how we change data type to make sure that x is of type float. Keep your code clean and readable, and test it using the data we've provided, each time assigning it to the x variable (by hardcoding it). Don't be discouraged by any initial failures. Be persistent and inquisitive.
Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here