# Changing a string category into a boolean 1,0

**URL:** <https://forum.codewithmosh.com/t/changing-a-string-category-into-a-boolean-1-0/7602>\
**Category:** Uncategorized\
**Created:** [September 28, 2021, 5:47am UTC](https://forum.codewithmosh.com/t/changing-a-string-category-into-a-boolean-1-0/7602 "2021-09-28T05:47:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![l\_zago](https://avatars.discourse-cdn.com/v4/letter/l/e47c2d/32.png) [@l\_zago](https://forum.codewithmosh.com/u/l_zago)\
**Post date:** [September 28, 2021, 5:47am UTC](https://forum.codewithmosh.com/t/changing-a-string-category-into-a-boolean-1-0/7602/1 "2021-09-28T05:47:45Z")

</div>

Hi guys, maybe it is not the place, but I did not find any particular source really helpful to help me with this.

I have a variable which return days, my condition is if days \< 60 then “paid” elseif “not paid”, how to program this in python ?  
Any help here will be appreciated

Best  
Lucas

---

<div class="post-metadata">

**Author:** ![SAM](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/sam/32/167_2.png) [@SAM](https://forum.codewithmosh.com/u/SAM)\
**Post date:** [September 28, 2021, 6:02am UTC](https://forum.codewithmosh.com/t/changing-a-string-category-into-a-boolean-1-0/7602/2 "2021-09-28T06:02:20Z")

</div>

Your question is a little bit weird… Your subject says you want to change a string into a boolean while the text talks about a condition that translates to a string. And you want a number of days to translate to “paid” or “not paid”?!? That doesn’t make much sense to me.

The Python keyword for “else if” or “elseif” is “`elif`”.

---

<div class="post-metadata">

**Author:** ![l\_zago](https://avatars.discourse-cdn.com/v4/letter/l/e47c2d/32.png) [@l\_zago](https://forum.codewithmosh.com/u/l_zago)\
**Post date:** [September 28, 2021, 12:22pm UTC](https://forum.codewithmosh.com/t/changing-a-string-category-into-a-boolean-1-0/7602/3 "2021-09-28T12:22:44Z")

</div>

Yes, my bad  
You could say actually that ‘not\_paid’ == 1 and ‘paid’ == 0
