Can we take a input from user as a bool?

i stored reversed value as a bool but it didnt give any result and didnt do anything in my araay of apairs but when i changed reversed trype to string it yielded correct result…

Yes you can take bool as input.
But the expected input will only be 0 and 1. 0 for false and 1 for true
If you give input as true or false, it will consider it as a string

cant we input true for a bool value ?

No…it will be treated as string