Use this repo to complete your practice for Lesson 2.1.
- 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)
Complete each exercise linked below. Be sure you are logged into ReadingBat!
Length
- len1 🪁
Slicing
Concatenation
-
- 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.)
- A quote from Boris Beizer is provided. Format it to display nicely on the screen when it prints.
-
- 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.
-
- 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.
- This program should:
-
- 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.
-
- This program should:
- Assign
Athenian Wilderness Experience
tojunior_year
. - Use string slicing to get
Wilderness
and print it. - Calculate the length of
Wilderness
- Print the length
- Assign
Example:
first output: Wilderness second output: Length: 10
- Note: there is a GitHub test for this. Be sure the output format matches the example.
- This program should:
-
- 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.
- Assign
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!