I have just started to learn python. I have installed and set the environment variables as per documentation. And from command prompt, I execute some python script,too. But I can't execute multiple line script, if the script contains any function. For example, see the following code -
It successfully prints the value of a and b.
But if I want to execute following types of script -
str1 = "Hello Monty Python!"
str2 = str1.replace('M', 'Spam')
str3 = str2.replace('P', 'Spam')
print( str1 )
print( str2 )
print( str3 )
I am not able to write this type of script in command line.
When I write the first Print statement i.e. print(str1) and press enter,
it prints the value of the str1.
Please suggest how to write this type of code in command line.
Thanks and regards,