Skip to content

Add python input documentation #3

Open
Samwest5 wants to merge 8 commits into
progteam:masterfrom
Samwest5:master
Open

Add python input documentation #3
Samwest5 wants to merge 8 commits into
progteam:masterfrom
Samwest5:master

Conversation

@Samwest5
Copy link
Copy Markdown

No description provided.

Added instructions on using input() and sys.stdin in Python
Added link to python input file from main page
Copy link
Copy Markdown
Contributor

@donaldong donaldong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this doc! I think people will find it useful :)

I made some comments mainly on the formatting.

Comment thread README.md Outdated
Comment thread pythoninput.md
Comment thread pythoninput.md Outdated
Comment thread pythoninput.md Outdated
Comment thread pythoninput.md Outdated
Comment thread pythoninput.md
```python
from sys import stdin
```
Can be used to iterate over lines of input, such as test cases for Kattis problems
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be worth mentioning this API would be useful when the number of input lines is unknown (read until EOF). The other way of handling the same situation is to catch EOFError using input().

Comment thread pythoninput.md
In Python we can do that with:

```python
split()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to move the split section to the end of the document? It would be useful for both input-reading API.

donaldong and others added 6 commits February 10, 2019 20:23
Co-Authored-By: Samwest5 <32149271+Samwest5@users.noreply.github.com>
Co-Authored-By: Samwest5 <32149271+Samwest5@users.noreply.github.com>
Co-Authored-By: Samwest5 <32149271+Samwest5@users.noreply.github.com>
Co-Authored-By: Samwest5 <32149271+Samwest5@users.noreply.github.com>
Co-Authored-By: Samwest5 <32149271+Samwest5@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants