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
    Shravya S
    Oct 20, 2021

    10/19 - Class 6 HW + Resources

    in Introduction to Python

    RESOURCES:

    Class slides: https://docs.google.com/presentation/d/19wPir2zEfD4v8Qev2pdne4F7gN-7Y6b3yHcSMTJQb6s/edit?usp=sharing

    Example code: https://replit.com/@ShravyaS/IntroToPython-6

    (Notes included in example code.)


    HOMEWORK: Same as last time!

    For this project, please build a mad-lib generator. Mad-libs are stories where the user fills out some words, which are inserted into a (sort of) template. For this project, please allow users to choose between (at least) 3 story templates. Think of using .title() and .capitalize() "Enter the number 1 if you want the story about cheeseburgers, the number 2 if you want the story about Romeo and Juliet, and 3 if …"

    https://madtakes.com/libs/152.html ​(example)


    Write your answer as a comment, and we’ll post the solution by next class. See you then!


    Note: VIP students, please contact us (Eric and me) about office hours. And of course, feel free to ask for help!

    1 comment
    0
    yujie7611
    Oct 27, 2021

    input1 = int(input('''Type 1 if You Don\'t Care,

    Type 2 if You Don\'t Want Sirius, Lupin,James to Die,

    Type 3 if You Don\'t Want The Marauders To Die: '''))


    if input1 == 1:

    print('ha!'.capitalize())

    print('you got tricked!'.capitalize())

    elif input1 == 2:

    print('you got tricked again!'.capitalize())

    print('haha!'.capitalize())

    elif input1 == 3:

    print('aw,you are right!'.capitalize())

    print('you didn\'t get tricked!'.capitalize())

    print('cry cry...'.capitalize())

    print('fine...'.capitalize())

    print('here is your thing...'.capitalize())

    print('At the end of the book,Harry wakes up and says,\"Where am I?\"\"Oh,sweety,you are finally awake.When you are 4 years old, you suddenly became asleep and now 7 years has gone,and you are finally awake!\"said a familiar voice.\"Mom?\"Harry can\'t believe his senses,his mother is still alive!\"You are still alive?And dad too?Sirius too?Lupin too?I thought they were all dead!So,am I old enough to go to Hogwarts? If you ask me why,mom,it is that in my dream, I see that they were all dead!But am I old enough to go to Hogwarts?\"Lily is surprised that her son,Harry Potter,was seeing all sorts of stuff in his dream.\"Oh,yes,sweety,yes.You are 11!Come,I think we got mail from Hogwarts.\"THE END')

    0
    1 comments

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

    • lol-101dotcom

    ©2020 Legion of Learners