logotransparent.png

Legion of Learners

www.lol-101.com

  • Home

  • Classrooms

  • Courses

  • About Us

    • Executive Team
    • Board Members
  • Resources

  • More

    Use tab to navigate through the menu items.
    To see this working, head to your live site.
    • Categories
    • All Posts
    • My Posts
    sfolax6776
    Nov 01, 2020
      ·  Edited: Nov 01, 2020

    String comparison: is 'ABC'>'abc'?

    in Introduction to Python

    Is "ABC">"abc"?


    A. Introduction No, all upper case letters are "less than" lower case letters. Among upper/lower case letters themselves, they are ordered alphabetically ascending. So, A<B<C<...<Z<a<b<c<...<z. But how to compare "!@#$" with "^*&>"?

    B. How to compare strings: https://www.journaldev.com/23511/python-string-comparison

    C. HW:

    1. Create three strings, then sort them alphabetically and print out.

    2. Use the image below as an inspiration to print out a dialogue between two characters. (2000 Kahoot! points)



    5 comments
    0
    luphy.ma
    Nov 03, 2020  ·  Edited: Nov 03, 2020

    go 2nd pumpkin maker


    idk if im doing this right : ]


    #Var e uh bowls yes = "yes" dfeae = "you are a joopeoaitepa" cringe = "Awesome" cringe1M = "radical" # *Compares string ***GOOD-LY**** print('abc' > 'abb') print('abb' > 'ABC') print('ABC' < 'abc') print('\nTime for the moment of truth \n\n') print(("!@#$" > "^*&>")) print("\n:(((((((((((((((((((") print(' \n\n\n\n\n') #Conversation print('helo google assistant') print(f"{yes:>200}\n") print("What am i") print(f"{dfeae:>211}\n") print("Can I have ur candy\n") print(f"{cringe:>142}\n") print("you are not fun to talk to\n") print(f"\n{cringe1M:>70}\n")

    0
    C. Kevin Chen
    Nov 05, 2020

    That looks great! You can even add speech balloons to each line of dialogue, like so:


    #Var e uh bowls yes = "yes" dfeae = "you are a joopeoaitepa" cringe = "Awesome" cringe1M = "radical" spacing = 70 line1 = 'helo google assistant' line2 = "What am i" line3 = "Can I have ur candy" line4 = "you are not fun to talk to" #Conversation print(' ' + "-"*len(line1)) print('(' + line1 + ')') print(' ' + '/' + "-"*(len(line1) - 1)) print('/') print(f"{'-'*len(yes):>70}") print(f"{'(' + yes:>70})") print(f"{'-'*(len(yes) - 1):>69}" + "\\") print(f"{' ':>70}"+ "\\") print(' ' + "-"*len(line2)) print('(' + line2 + ')') print(' ' + '/' + "-"*(len(line2) - 1)) print('/') print(f"{'-'*len(dfeae):>70}") print(f"{'(' + dfeae:>70})") print(f"{'-'*(len(dfeae) - 1):>69}" + "\\") print(f"{' ':>70}"+ "\\") print(' ' + "-"*len(line3)) print('(' + line3 + ')') print(' ' + '/' + "-"*(len(line3) - 1)) print('/') print(f"{'-'*len(cringe):>70}") print(f"{'(' + cringe:>70})") print(f"{'-'*(len(cringe) - 1):>69}" + "\\") print(f"{' ':>70}"+ "\\") print(' ' + "-"*len(line4)) print('(' + line4 + ')') print(' ' + '/' + "-"*(len(line4) - 1)) print('/') print(f"{'-'*len(cringe1M):>70}") print(f"{'(' + cringe1M:>70})") print(f"{'-'*(len(cringe1M) - 1):>69}" + "\\") print(f"{' ':>70}"+ "\\")

    0
    albertwwyy
    Nov 08, 2020

    That is complicated

    0
    albertwwyy
    Nov 08, 2020

    i am having a little trouble doing this

    0
    albertwwyy
    Nov 08, 2020

    Did I do what was expected? I tend to go easier, since im still trying to remember how to do most of the string multiplacation.



    print('!@#$'<'^*&>') print('zzz'>'aaa') print('kbf'<"tqr") print('trr'>'ggg') print('Guy:') print('Hello Mr Robot, hows your day?') print('Robot:') print('Hello, can I assist you?') print('uhh, no thanks *Disables robot*') print('*chuckles* Im in danger') print('FBI TEAM:') print('FBI OPEN UP')

    0
    5 comments

    Questions? Email us at legionoflearners@gmail.com or join our WeChat group!

    • lol-101dotcom

    ©2020 Legion of Learners