commit c0f31768e07d56ffc5cb4e6c8d3222974eba9ca0 Author: Kenneth Date: Thu May 21 17:09:36 2015 -0400 assessment for scalpers diff --git a/2-separate-commas/commas.py b/2-separate-commas/commas.py new file mode 100644 index 0000000..d94feef --- /dev/null +++ b/2-separate-commas/commas.py @@ -0,0 +1,7 @@ +def separate_comma(int): + pass + +print(separate_comma(100) == '100') +print(separate_comma(1000) == '1,000') +print(separate_comma(1234567890) == '1,234,567,890') +print(separate_comma(1234567890098765432123456789098765432134567890) == "1,234,567,890,098,765,432,123,456,789,098,765,432,134,567,890") \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..f9a8497 --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ +Phase 1 Assessment +------------------ + +Scalpers! You have from 10am - 3:30pm(ish) to work on this. You should be able to complete these challenges in that time. + + +### Challenge 1: Contacts + +Create a simple terminal app that allows one user to manage their contacts / personal phonebook. Think about how the contacts app in your smartphone works. + +The user can create a contact. A contact must have a name, and can have many email addresses and many phone numbers. + +The user can view all their contacts, in alphabetical order by name. + +The user can edit the contact's name, and edit or delete email addresses and phone numbers. + +Note - there is no user administration in this app. They do not need to log in to manage contacts. Assume just one person runs one copy of your application. + +Keep all your files in the `1-contacts` folder and don't forget to keep the Zen of Python in mind. If you forget what it is, go to your Python interpretor and import `this`. + + +### Challenge 2: Separate Numbers with Commas + +Write a method `separate_comma` which takes an integer as its input and returns a comma-separated integer as a string. Like this: + +```python +separate_comma(1000) # => "1,000" +separate_comma(1000000) # => "1,000,000" +separate_comma(0) # => "0" +separate_comma(100) # => "100" +``` + +DO NOT use regular expressions and make sure the tests pass! It's all about the logic! \ No newline at end of file