Does SSMS v17 allow user input in Python scripts?
I cannot see any possible way for this to work given that the script is being submitted through a back-end service where there is no user-context (i.e. display, etc). SSMS is not executing anything. It is merely submitting those statements to SQL Server which handles the execution (even if SQL Server then passes it off to something else).

The only potential possibility of getting around this, and it is would have been a long-shot and not likely to be a practical work-around even if it does did work, is to run this statement against SQL Server Express LocalDB. Because LocalDB runs in user mode (not an NT service), it does have access to the console / display. I know this because I have been able to pop-up a Windows dialog / confirm box via SQLCLR when using LocalDB :-D.

HOWEVER, I just tried and couldn't even get the print to work. So, I checked the supported features list ( Editions and supported features of SQL Server 2017 ) and neither R nor Python are available in Express Edition, and hence not in LocalDB. :-(