Aug-21-2020, 01:17 AM
Case 1: If I execute the following:
one two
Case 2: But I execute the following in IDLE:
'one two'
Why is the output without strings in the first case and with quotes in the second? I understand that there is an implicit print following the primary prompt, i.e. >>>
So why is the output different.
Case 3: Also, in the following:
After defining x, if the
one two
Is it simply that the implicit Python print after >>> not format outputted strings without quotes?
print('{} {}'.format('one', 'two'))the output in the IDLE shell will be
one two
Case 2: But I execute the following in IDLE:
>>> x = '{} {}'.format('one', 'two') >>> xthe output will be
'one two'
Why is the output without strings in the first case and with quotes in the second? I understand that there is an implicit print following the primary prompt, i.e. >>>
So why is the output different.
Case 3: Also, in the following:
After defining x, if the
>>>print(x)The output is:
one two
Is it simply that the implicit Python print after >>> not format outputted strings without quotes?