简体   繁体   中英

How to translate bool array from c++ to Python

I am translating code from c ++ to python, I met with such a data type:

bool b[110];

How can this be translated into Python? I tried to do something, but in my opinion something is wrong here.

b = [False] * (110)

I don't really see a difference between bool b[110]; and b = [False] * 110 . Besides that bool b[110]; only does "Garbage initialization" and python doesn't have anything even remotely similar to that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM