Avatar ·

How to split all integers in an array into individual digits?

📁 List, Advanced Python Topics, question, Useful Tips and Lifehacks

Good day! I'm interested in this question.
Suppose there is code like this:

a = list(range(1,11))  print(a)  

It will output [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

My question is: is there any way to split the two-digit number 10 into two separate list elements, i.e. so that the final list looks like this:
[1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 0]

If you're wondering "why" this is needed at all, I can explain.
The task is as follows: create a list of numbers from a to b (they are specified by the user), then count

Avatar ·

I know the simple and complex options.

Simple through transparency of the entire widget:

import sysfrom PyQt5.QtWidgets import QApplication, QWidgetclass Example(QWidget):    def __init__(self):        super().__init__()        self.setWindowTitle('Example')        self.setGeometry(300, 300, 300, 220)        self.setWindowOpacity(0.6)if __name__ == 
                            

Log in to leave an answer

Blogs