Homework02

.pdf

School

University of California, Berkeley *

*We aren’t endorsed by this school

Course

C88C

Subject

Industrial Engineering

Date

Apr 3, 2024

Type

pdf

Pages

7

Uploaded by ConstableElement10235

Report
Autograder Results Final Score: 8.0 okpy summary Point breakdown fib: 1.0/1 nonzero: 1.0/1 has_n: 1.0/1 total_price: 1.0/1 arange: 1.0/1 reverse_iter_for: 1.0/1 reverse_iter_while: 1.0/1 Score: Total: 7.0 Cannot backup when running ok with --local. Complete okpy output (click to open) Graded Homework 02 Student Kira Obsitnik Total Points 8 / 8 pts Autograder Score 8.0 / 8.0 Passed Tests Doctests for fib (1/1) Doctests for nonzero (1/1) Doctests for has_n (1/1) Doctests for total_price (1/1) Doctests for arange (1/1) Doctests for reverse_iter_for (1/1) Doctests for reverse_iter_while (1/1)
Doctests for fib (1/1) >>> from hw02 import * >>> fib(0) 0 >>> fib(1) 1 >>> fib(2) 1 >>> fib(3) 2 >>> fib(4) 3 >>> fib(5) 5 >>> fib(6) 8 >>> fib(100) 354224848179261915075 Doctests for nonzero (1/1) >>> from hw02 import * >>> nonzero([1, 2, 3]) 1 >>> nonzero([0, 1, 2]) 1 >>> nonzero([0, 0, 0, 0, 0, 0, 5, 0, 6]) 5 Doctests for has_n (1/1) >>> from hw02 import * >>> has_n([1, 2, 2], 2) True >>> has_n([0, 1, 2], 3) False >>> has_n([], 5) False
Doctests for total_price (1/1) >>> from hw02 import * >>> total_price([5, 20, 30, 7]) 87 >>> total_price([8, 4, 3]) 15 >>> total_price([10, 100, 4]) 164 Doctests for arange (1/1) >>> from hw02 import * >>> arange(1, 3) [1, 2] >>> arange(0, 25, 2) [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24] >>> arange(999, 1231, 34) [999, 1033, 1067, 1101, 1135, 1169, 1203] Doctests for reverse_iter_for (1/1) >>> from hw02 import * >>> reverse_iter_for([1, 2, 3, 4]) [4, 3, 2, 1] Doctests for reverse_iter_while (1/1) >>> from hw02 import * >>> reverse_iter_while([1, 2, 3, 4]) [4, 3, 2, 1] Submitted Files
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help