Changes

Jump to: navigation, search

OPS435 Python Lab 4

3 bytes added, 10:22, 21 June 2017
PART 1 - Strings and Substrings
</source>
 :::*The script should contain '''four''' functions::::::'''first_five()''' function:<ul><li>Accepts a single string argument</li><li>Returns a string that contains the first five characters of the argument given</li></ul>:::*The ::'''last_seven()''' function:<ul><li>Accepts a single string argument</li><li>Returns a string that contains the last seven characters of the argument given</li></ul>:::*The ::'''middle_number()''' function:<ul><li>Accepts a integer as a argument</li><li>Returns a string containing the second and third characters in the number</li></ul>:::*The ::'''first_three_last_three()''' function:<ul><li>Accepts two string arguments</li><li>Returns a single string that starts with the first three characters of argument1 and ends with the last three characters of argument2</li></ul>
:::*Example: first_three_last_three('abcdefg', '1234567') returns single string 'abc567'
::::'''Sample Run 1'''<source>
13,420
edits

Navigation menu