0
a = [1,2,3]
b = a[:]
a[1] = 4
print(a)
print(b)

**when i run this code(run python files in terminal, run selection file in terminal), i can see the two different message in terminal One is

/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 "/Users/moontaeyeong/OneDrive/python/day 3.py" File "", line 1 /Library/Frameworks/Python.framework/Versions/3.9/bin/python3 "/Users/moontaeyeong/OneDrive/python/day 3.py" ^ SyntaxError: invalid syntax <<< and second thing is

printed correct value like this a = [1,2,3] b = a[:] a[1] = 4 print(a) [1, 4, 3] print(b) [1, 2, 3]** <<<< so.. i got a two question. first. what's the defferece between "run python files in terminal" and "selection python file in terminal" second, when i run the selection file(whole lines), why return like that? i can't understand the reason why return the whole things. (what i pointed as(>>>)) a = [1,2,3] b = a[:] a[1] = 4 print(a) [1, 4, 3] print(b) [1, 2, 3] P.S. i'm not good at ENG, but i have to use this community because i heared community as the best way for strong developer, plz give me a hand bro :D**

  • Please see this lokks related. https://stackoverflow.com/questions/51540391/invalid-syntax-error-when-running-python-from-inside-visual-studio-code – Praveen Mar 20 '21 at 07:00
  • Yes, it's exactly that problem. For the future, please also read [ask] and take the [tour], and make sure you understand how to format your post correctly. – Karl Knechtel Mar 20 '21 at 07:04
  • thank you for comment me. i'll learn how to ask and take the tour. and following the praveen's comment. i'm gonna study ENG hardly.. have a nice day!! – corinbee Mar 20 '21 at 07:12

0 Answers0