Skip to editor
File
New File Ctrl+N
New Folder

Save Ctrl+S
Upload File…
Download as ZIP

Delete File

Reset Files…
View
Toggle Sidebar Ctrl+B
Toggle Terminal Ctrl+`

Word Wrap Alt+Z

Exercise Info
Run
Run Code Ctrl+Enter
Save & Run F5

Clear Output
CS 271: Module 1: Python Basics Part 2 (1.5 pts)
Explorer
GitHub

Connect to GitHub to push and pull your project files to a repository.

On the page that opens, create a token with repo scope, copy it, then paste it below.

Paste the personal access token you created on GitHub with repo scope.

Click Refresh to load commit history
Exercise Info

Goals

  1. To use slicing notation in python
  2. To apply string concatenation in python

Instructions

One thing I find myself doing all the time is converting formats of multimedia data with python scripts. Part of this is just getting the file paths correct. Let's say I wanted to convert an image file with a .jpg format to a .png format. Write the code comes up with the correct .png target filename using string slices and string concatenation. Hint: You can use a negative index as the end of a slice.



The Ursinus-WebIDE by Chris Tralie (opens in new tab) and Bill Mongan (opens in new tab)

Your browser does not support WebGL. A graphical rendering canvas would appear here.


          
No suggestions. Code quality feedback will appear here.
Not logged in python
Ln 1, Col 1