# One string more than another (\>)

**URL:** <https://forum.codewithmosh.com/t/one-string-more-than-another/17710>\
**Category:** Python\
**Created:** [January 16, 2023, 6:24am UTC](https://forum.codewithmosh.com/t/one-string-more-than-another/17710 "2023-01-16T06:24:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aaavng](https://avatars.discourse-cdn.com/v4/letter/a/2bfe46/32.png) [@aaavng](https://forum.codewithmosh.com/u/aaavng)\
**Post date:** [January 16, 2023, 6:24am UTC](https://forum.codewithmosh.com/t/one-string-more-than-another/17710/1 "2023-01-16T06:24:36Z")

</div>

Hello in the Complete Python Mastery Course, in Section 3 - Control Flow, Episode 7 - Quiz, there is a comparison between “bag” \> “apple” and “bag” \> “cat”. From a previous episode, I remembered that “bag” \> “apple” is True. However, I do not know how to tell that “cat” comes after “bag”.  
Additionally, since each character is tied to a number in python, how does it calculate the total? Is it a summation of all the numbers tied to the characters in the string that python then uses to calculate the expression?

---

<div class="post-metadata">

**Author:** ![AzharUddinSheikh](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/azharuddinsheikh/32/5561_2.png) [@AzharUddinSheikh](https://forum.codewithmosh.com/u/AzharUddinSheikh)\
**Post date:** [February 1, 2023, 10:18am UTC](https://forum.codewithmosh.com/t/one-string-more-than-another/17710/2 "2023-02-01T10:18:25Z")

</div>

[ASCII Table](https://www.cs.cmu.edu/~pattis/15-1XX/common/handouts/ascii.html)

`cat > bag`  
using `ASCII` get the value of `c & b` in lowercase we get `99 & 98`  
so `99 > 98` which is `True`

---

<div class="post-metadata">

**Author:** ![aaavng](https://avatars.discourse-cdn.com/v4/letter/a/2bfe46/32.png) [@aaavng](https://forum.codewithmosh.com/u/aaavng)\
**Post date:** [February 3, 2023, 5:46am UTC](https://forum.codewithmosh.com/t/one-string-more-than-another/17710/3 "2023-02-03T05:46:05Z")

</div>

Ohh ok so it compares using the first letter. I forgot about the table so was super confused. Thank you!
