Stuck on input-output evaluation YAML-file #5192
-
Hi, I'm struggling with creating a correct suite.yaml file for evaluation of an programming exercise where the students are asked to make a code that calculates the area of a trapezoid based on 3 inputs:
As you can see python asks the user for 3 inputs. I tried creating a suite.yaml file with 1 test as follows:
but this clearly doesn't work because of the stdin: "1", "2", "3". I have no idea how to fix this error though? Any ideas how to write a correct yaml-file that would work for this code? Many thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The - tab: oppervlakte-trapezium
testcases:
- stdin: |
1
2
3
stdout: 4.5 The - tab: oppervlakte-trapezium
testcases:
- stdin: "1\n2\n3"
stdout: 4.5 |
Beta Was this translation helpful? Give feedback.
The
input()
function in Python always reads a single line fromstdin
. This means that if you want to pass three inputs, you need to put three lines onstdin
:The
|
in YAML is a special syntax to write multiple lines. Alternatively, you can be explicit: