Why sys.ps1 & sys.ps2 are not defined? How to use smth similar for the prompt string? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why sys.ps1 & sys.ps2 are not defined? How to use smth similar for the prompt string?

https://code.sololearn.com/cAJalFc5dymZ/?ref=app

25th Sep 2019, 8:41 AM
UraL
2 Answers
+ 1
According to documentation ps1 and ps2 "Strings specifying the primary and secondary prompt of the interpreter. These are only defined if the interpreter is in interactive mode. Their initial values in this case are '>>> ' and '... '. If a non-string object is assigned to either variable, its str() is re-evaluated each time the interpreter prepares to read a new interactive command; this can be used to implement a dynamic prompt." They are not defined as code is not run in interactive mode
21st Apr 2020, 10:33 PM
Piotr Szajer
Piotr Szajer - avatar
0
Good answer
22nd Apr 2020, 5:33 AM
UraL