Is there a way to assign multiple lines at once in python?
For example, if I want to assign to lines 1, 3, 4
list = [1,1,1,1,1,1,1,]
list  = 3
list  = 3
list  = 3
If I want to assign the same number like
In the slide, 134 does not work because it is not an arithmetic sequence.
Please give me a detailed answer.
Answer # 1
lst = [1, 1, 1, 1, 1, 1, 1,] for idx in [0, 2, 3]: lst [idx] = 3
- python - when combining different lines for each mode, switching the mode will change the whole
- about for syntax i want to know the reason why the result is different depending on where the initial value is defined python
- python - i want to delete all lines that contain a pandas string
- python - determine if there is a django object and transition to the screen
- python - i can't double derivative and assign functions in sympy
- how to create as many dictionaries as there are scraped lists in python?
- python - draw a specified number of straight lines at equal intervals
- python 3x - [pycharm/python3] there is no problem in debug mode, but i can't get out of the input loop when i run it in the term
- python - is there a time limit when executing input () with pyscripter?
- python 3x - python3: if there is a specific character string in the file, i want to divide the process and execute it only once
- python 3x - python3: i want to separate the processing if there is a specific character string in the file
- read a python text file and get n lines from the line starting with the specified string
- [python] i want to calculate matrices of different sizes using iteration
- exclude even and odd lines in python csv
- python 3x - concatenation of tables with different indexes in pandas
- python - there is a delay in the result predicted by keras lstm and i want to improve it
- how to know when there is no information element in python scraping
- are there any programming ideas you should learn to learn python?
- python - how to determine if there is a string containing a period in a column in the dataframe
- [python/exception handling] is there a way to deliver the caught exception to the parent as it is?
- php - coincheck api authentication doesn't work
- php - i would like to introduce the coincheck api so that i can make payments with bitcoin on my ec site
- [php] i want to get account information using coincheck api
- python - you may need to restart the kernel to use updated packages error
- python 3x - typeerror: 'method' object is not subscriptable
- the emulator process for avd pixel_2_api_29 was killed occurred when the android studio emulator was started, so i would like to
- xcode - pod install [!] no `podfile 'found in the project directory
- vuejs - [vuetify] unable to locate target [data-app] i want to unit test to avoid warning
- android studio - unresolved reference comes out in kotlin