Simple confirmation through user input msg(str): Message expecting a yes or no answer Returns True if answer is "yes" and False otherwise.
(msg)
| 467 | |
| 468 | |
| 469 | def confirm(msg): |
| 470 | """Simple confirmation through user input |
| 471 | |
| 472 | msg(str): Message expecting a yes or no answer |
| 473 | Returns True if answer is "yes" and False otherwise. |
| 474 | """ |
| 475 | question = f'{msg} (y/n) ' |
| 476 | answer = '' |
| 477 | while answer not in ('y', 'n'): |
| 478 | answer = input(question).lower() |
| 479 | return answer == 'y' |
| 480 | |
| 481 | |
| 482 | def size_to_str(size): # type: (int) -> str |
no outgoing calls
no test coverage detected