Lib
Lib

Reputation: 29

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)

Upvotes: 0

Views: 100

Answers (1)

Teddy
Teddy

Reputation: 594

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.

Upvotes: 1

Related Questions