assessment for scalpers
This commit is contained in:
commit
c0f31768e0
7
2-separate-commas/commas.py
Normal file
7
2-separate-commas/commas.py
Normal file
@ -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")
|
33
README.md
Normal file
33
README.md
Normal file
@ -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!
|
Loading…
x
Reference in New Issue
Block a user