Skip to content

Athenian-Computer-Science/strings1-practice-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lesson 2.1 Practice (Strings 1)

Use this repo to complete your practice for Lesson 2.1.

Complete the following:

Edpuzzle

  • Edpuzzle practice 🪁
    • Use this for practice during the Edpuzzle video. You can use the main window or the Python Console (see button at the bottom of the PyCharm window)

ReadingBat

Complete each exercise linked below. Be sure you are logged into ReadingBat!

Length

Slicing

Concatenation

Fix & Write Code

  • Fix the Code #1 🪁

    • A quote from Boris Beizer is provided. Format it to display nicely on the screen when it prints.
      • You should not have to scroll sideways to see the output!
      • Be sure to use a multi-line quote, \n and \t escape characters, and any other formatting you wish.
      • Note that the style conventions state that there should only be 79 characters in a line. Format your paragraphs a
    • Be sure to run your program to be sure it works correctly. (There is no test code for this.)
  • Write Code #1 🚁

    • Write a (very) short play (4-6 lines). As with any script, each character's dialogue should be displayed on their own line.
    • Here's the catch: you can only use 1 print statement!! 😲
    • Use \n and \t at least once in your program. You may also use multi-line strings or any other formatting you wish.
  • Fix the Code #2 🪁

    • This program should:
      • prompt the user for two different strings
      • concatenate them
      • print the result and the length of the new string

    Example:

    Enter a word: (buffalo)
    Enter another word: (tiger)
    The string buffalotiger has 12 letters.
    
    • Note: there is a GitHub test for this. Be sure the output format matches the example.
  • Write Code #2 🚁

    • Prompt the user for three strings
    • Concatenate them together with spaces between them
    • Print the result

    Example:

    Enter a word: (apple)
    Enter a second word: (purple)
    Enter a third word: (kite)
    output: apple purple kite
    
    • Note: there is a GitHub test for this. Be sure the output format matches the example.
  • Fix the Code #3 🚁

    • This program should:
      • Assign Athenian Wilderness Experience to junior_year.
      • Use string slicing to get Wilderness and print it.
      • Calculate the length of Wilderness
      • Print the length

    Example:

    first output: Wilderness
    second output: Length: 10
    
    • Note: there is a GitHub test for this. Be sure the output format matches the example.
  • Write Code #3 🪁

    • Assign supercalifragilisticexpialidocious to a variable.
    • Use string slicing to print the string agilisitic
    • Note: there is a GitHub test for this. Be sure the output format matches the example.

Submitting your Repo

When you are done, commit and push to GitHub. Then, check the repo in your browser to be sure it passed the tests.

Note: If you are pressed for time and are excused from the 🚁 exercises, GitHub will not display a green ✔. See Megan for help checking to be sure the 🪁 exercises passed the tests.

Attribution:

Thank you to Bianca Ruiz @RuiztheRuler for providing a great starting place for automating feedback!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages