Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Console: - 1 7 FAILURE, predicted answer was 1 , computed answer was - 1 7 . Feedback: Not Enough Stud nt Unit Tests You

Console:
-17
FAILURE, predicted answer was 1, computed answer was -17.
Feedback:
Not Enough Studnt Unit Tests
You have not written enough unit tests.
View:
answer.py
plus and minus.txt
Add New -
Blocks
Split
Text
Reset
Import datasets
Upload
9 History
Variables from cisc108 import assert_equal
Decisions
Iteration
Functions
Calculation
Output
Input
Turtles
Values
Conversion
Lists
Dictionaries
from cisc108 import assert_equal
def convert_operator(ch):
if ch=='+':
return 1
elif ch=='-':
return -1
else:
return 0
f= open ('plus and minus.txt')
data =f*read()
total =0
for s in data:
total += convert_operator(s)
print(total)
f. close ()
assert_equal(total,(convert_o.perator(s)))
18
Load Assianment
ISave Assionment
Load File
Save File,
Load Dataset
Loa Event
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What is meant by the term microstructure?

Answered: 1 week ago

Question

10-9 How have social technologies changed e-commerce?

Answered: 1 week ago