Skip to content

Stuck on input-output evaluation YAML-file #5192

Discussion options

You must be logged in to vote

The input() function in Python always reads a single line from stdin. This means that if you want to pass three inputs, you need to put three lines on stdin:

- tab: oppervlakte-trapezium
  testcases:
    - stdin: |
        1
        2
        3
      stdout: 4.5

The | in YAML is a special syntax to write multiple lines. Alternatively, you can be explicit:

- tab: oppervlakte-trapezium
  testcases:
    - stdin: "1\n2\n3"
      stdout: 4.5

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@antonthys
Comment options

Answer selected by antonthys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants