You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Almenon edited this page Dec 29, 2018
·
1 revision
You can hardcode stdin in three ways:
defstandard_input():
yield'hello'yield'world'standard_input= ["hello", "world"]
standard_input="hello\nworld"print(input()) # prints helloprint(input()) # prints world# print(input()) # there is no more input - StopIteration error would be raised