You accomplished 6.5 (at least 4.5) of the 9 core goals.
~
partial
Style Requirements
Checks regarding the raw text of your code file and how it is organized stylistically (e.g., how many characters are in a line of code, or how many comments there are).
Accomplished some of the core style goals.
~
partial
Core goals
Complete all core goals for core credit. Get partial credit for completing at least half, and more partial credit for completing at least 90%.
Accomplished 1.5 of 2 goals.
✓
accomplished
Do not ignore the results of any fruitful function calls.
According to the "Don't waste fruit" principle, every place you call a fruitful function (built-in or custom) you must store the result in a variable, or that function call must be part of a larger expression that uses its return value.
All calls to fruitful functions in your code correctly made use of their results.
~
partial
Do not create any variables that you never make use of.
According to the "Don't waste boxes" principle, every time you create a variable (using = or by defining a parameter for a function) you must also later use that variable as part of another expression. If you need to create a variable that you won't use, it must have the name _, but you should only do this if absolutely necessary.
Your code created 2 variables which it did not make use of:
Found the following variables that were never used:
Code checks which require that your code is written in a certain way, regardless of what happens when it runs (e.g., how many lines of code call a certain function).
Accomplished some of the core procedure goals.
~
partial
Core goals
Complete all core goals for core credit. Get partial credit for completing at least half, and more partial credit for completing at least 90%.
Accomplished 4 of 5 goals.
✓
accomplished
No errors loading code.
Your code should be able to be loaded without errors. Run your code before submitting it to make sure this is true.
Complete all extra goals in addition to the core goals for a perfect score.
Accomplished 0 of 1 goal.
✗
failed
Use a multiplication by 7
Use 7 * _ in exactly one place.
Expected exactly 1 multiplication by 7, found 0.
~
partial
Behavior Requirements
Behavior tests that run your code and check what inputs it requests from and what outputs it displays to the user (e.g., what is printed given certain typed inputs).
Accomplished some of the core behavior goals.
~
partial
Core goals
Complete all core goals for core credit. Get partial credit for completing at least half, and more partial credit for completing at least 90%.
Accomplished 1 of 2 goals.
~
partial
Your file prints the correct output
The output printed when your entire file is run must match the solution output.
File "<task>potluck/load.py", line 134, in create_module_from_code
12
exec(bytecode, module.__dict__, module.__dict__)
13
File "<task>test_interactive.py", line 25, in <module>
14
TypeError: can't multiply sequence by non-int of type 'float'
Your code
File interactive.py
80 characters
⇥
1 """2 interactive.py3 4 Your name: Peter Mawhorter5 Your username: pmwh6 Submission date: 2021-6-287 """8 9 # PART 1: Get Input10 # Gather input from the user about time spent on different categories of11 # activities during each week. Since inputs are "strings", convert them12 # immediately to int or float values. There should be a total of 6 questions.13 14 name=input('What is your name? ')15 dogs=input('How many dogs do you have? ')16 diet=input('On average, how much does each dog eat per day (in cups)? ')17 density=input(18 'On average, how much does one cup of dog food weigh (in lbs)? '19 )20 21 dogCount=int(dogs)22 dietCups=float(diet)23 densityLbs=float(density)24 25 lbsPerWeek=dietCups*densityLbs*dogs26 27 28 print(29 "Your dog(s) eat "30 +str(round(lbsPerWeek,2))31 +"lbs of dog food every week."32 )33 34
80 characters
⇥
Test results
File 'interactive.py'
We will evaluate your submitted file 'interactive.py'.
Evaluating 'interactive.py'
Code in the target file
We parsed the code in the target file and paidattention to how it was written.
The code for 'interactive.py' (shown elsewhere).
Program output ('Valentina' input)
We ran your program with some example inputs, and observed what it printed.
We ran your submitted code
Testing details:
Will be terminated if it takes longer than 5s.
Printed output and error messages will be recorded.
The following inputs will be provided:
'Valentina'
'3'
'2'
'1'
Your output
Solution output
Comparison
What is your name? Valentina
How many dogs do you have? 3
On average, how much does each dog eat per day (in cups)? 2
On average, how much does one cup of dog food weigh (in lbs)? 1
Traceback (most recent call last):
File "potluck/harness.py", line 425, in capturing_payload
result = payload(context)
File "potluck/harness.py", line 129, in payload
module = load.create_module_from_code(node, full_name)
File "potluck/load.py", line 134, in create_module_from_code
exec(bytecode, module.__dict__, module.__dict__)
File "test_interactive.py", line 25, in
TypeError: can't multiply sequence by non-int of type 'float'
What is your name? Valentina
How many dogs do you have? 3
On average, how much does each dog eat per day (in cups)? 2
On average, how much does one cup of dog food weigh (in lbs)? 1
Feeding information for Valentina:
Your dog(s) eat 42.0 lbs of dog food every week.
File "<task>potluck/load.py", line 134, in create_module_from_code
12
exec(bytecode, module.__dict__, module.__dict__)
13
File "<task>test_interactive.py", line 25, in <module>
14
TypeError: can't multiply sequence by non-int of type 'float'
15
Program output ('Hamad' input)
We ran your program with some example inputs, and observed what it printed.
We ran your submitted code
Testing details:
Will be terminated if it takes longer than 5s.
Printed output and error messages will be recorded.
The following inputs will be provided:
'Hamad'
'1'
'2.5'
'0.75'
Your output
Solution output
Comparison
What is your name? Hamad
How many dogs do you have? 1
On average, how much does each dog eat per day (in cups)? 2.5
On average, how much does one cup of dog food weigh (in lbs)? 0.75
Traceback (most recent call last):
File "potluck/harness.py", line 425, in capturing_payload
result = payload(context)
File "potluck/harness.py", line 129, in payload
module = load.create_module_from_code(node, full_name)
File "potluck/load.py", line 134, in create_module_from_code
exec(bytecode, module.__dict__, module.__dict__)
File "test_interactive.py", line 25, in
TypeError: can't multiply sequence by non-int of type 'float'
What is your name? Hamad
How many dogs do you have? 1
On average, how much does each dog eat per day (in cups)? 2.5
On average, how much does one cup of dog food weigh (in lbs)? 0.75
Feeding information for Hamad:
Your dog(s) eat 13.12 lbs of dog food every week.
File "<task>potluck/load.py", line 134, in create_module_from_code
12
exec(bytecode, module.__dict__, module.__dict__)
13
File "<task>test_interactive.py", line 25, in <module>
14
TypeError: can't multiply sequence by non-int of type 'float'
15
Program output ('Wenyu' input)
We ran your program with some example inputs, and observed what it printed.
We ran your submitted code
Testing details:
Will be terminated if it takes longer than 5s.
Printed output and error messages will be recorded.
The following inputs will be provided:
'Wenyu'
'1'
'1.19201'
'0.5842'
Your output
Solution output
Comparison
What is your name? Wenyu
How many dogs do you have? 1
On average, how much does each dog eat per day (in cups)? 1.19201
On average, how much does one cup of dog food weigh (in lbs)? 0.5842
Traceback (most recent call last):
File "potluck/harness.py", line 425, in capturing_payload
result = payload(context)
File "potluck/harness.py", line 129, in payload
module = load.create_module_from_code(node, full_name)
File "potluck/load.py", line 134, in create_module_from_code
exec(bytecode, module.__dict__, module.__dict__)
File "test_interactive.py", line 25, in
TypeError: can't multiply sequence by non-int of type 'float'
What is your name? Wenyu
How many dogs do you have? 1
On average, how much does each dog eat per day (in cups)? 1.19201
On average, how much does one cup of dog food weigh (in lbs)? 0.5842
Feeding information for Wenyu:
Your dog(s) eat 4.87 lbs of dog food every week.
File "<task>potluck/load.py", line 134, in create_module_from_code
12
exec(bytecode, module.__dict__, module.__dict__)
13
File "<task>test_interactive.py", line 25, in <module>
14
TypeError: can't multiply sequence by non-int of type 'float'
15
Program output ('Paolo' input)
We ran your program with some example inputs, and observed what it printed.
We ran your submitted code
Testing details:
Will be terminated if it takes longer than 5s.
Printed output and error messages will be recorded.
The following inputs will be provided:
'Paolo'
'0'
'0'
'0'
Your output
Solution output
Comparison
What is your name? Paolo
How many dogs do you have? 0
On average, how much does each dog eat per day (in cups)? 0
On average, how much does one cup of dog food weigh (in lbs)? 0
Traceback (most recent call last):
File "potluck/harness.py", line 425, in capturing_payload
result = payload(context)
File "potluck/harness.py", line 129, in payload
module = load.create_module_from_code(node, full_name)
File "potluck/load.py", line 134, in create_module_from_code
exec(bytecode, module.__dict__, module.__dict__)
File "test_interactive.py", line 25, in
TypeError: can't multiply sequence by non-int of type 'float'
What is your name? Paolo
How many dogs do you have? 0
On average, how much does each dog eat per day (in cups)? 0
On average, how much does one cup of dog food weigh (in lbs)? 0
Feeding information for Paolo:
Your dog(s) eat 0.0 lbs of dog food every week.