python I'm studying, so I'll summarize what I've learned. Added at any time. I would appreciate it if you could let me know if there are any mistakes.
>pip install virtualenv
>virtualenv Name
>Name\Scripts\activate.bat
You need py -m to run it at the command prompt (it seems that you don't need it for VS Code) The top is unnecessary if it is installed. Create a virtual environment called Name in the second line, activate in the third line Hopefully the head will be (Name).
Declare a dictionary
List = [Value1, Value2, ・ ・ ・]
Output the 0th value. [-1] is the last value, and [-2] is the second value from the back.
print(List[0])
Add element to end of list
team.append ("dog ")
Overwrite list elements
team [0] = ("cat ")
Delete list element
team.pop(0)
Declare a dictionary
Dict = {Key: Value, ・ ・ ・}
output
print(Dict)
Output Value corresponding to Key
print(Dict[Key])
Add / Overwrite
Dict[Key2] = Name
Erase
del Dict[Key]
Recommended Posts