---
# System prepended metadata

title: Team_2

---

---
title: Team_2
---
# Team_2 Group Activity 
## week_2

set_name()

- First name at least 3 characters, no more than 30
    - Contains only letters (upper or lower) and dashes
- Last name at least 3 characters, no more than 50
    - Contains only letters (upper or lower), spaces and dashes
- Middle name can be None, otherwise can be between 1 and 50 chars
    - Cannot be longer than first name and cannot be longer than last name


```
def set_name(first_name, middle_name, last_name):
    first = len(first_name) in range(3, 31) and all(char.isalpha() or char = "-" for char in first_name)
    middle = middle_name is None or (len(middle_name) in range(1, min(len(first_name), len(last_name)) + 1))
    last = len(last_name) in range(3, 51) and all(char.isalpha() or char = "-" or char = " " for char in last_name)
    return first and middle and last
```

#### edge cases
> - len(Firstname) < 3 => Return False
> - len(Firstname) > 30 => Return False
> - First name contains bad things => Return False
> - len(Lastname) < 3 => Return False
> - len(Lastname) > 50 => Return False
> - len(Middlename) < 1 => Return False
> - len(Middlename) > len(Firstname) => Return False 
> - len(Middlename) > len(Lastname) => Return False
> - Middlename == None => Return True 
> - any(char.isdigit() for char in firstname) == true => return false
> - any(char.isdigit() for char in Middlename) == true => return false
> - any(char.isdigit() for char in lastname) == true => return false

## week_3
Each group in the tutorial should share a summary of their teams plans and progress in relation to:

- When (or if) they are running standups and whether they are synchronous or asynchronous
    - Roughly every two days, synchronous standups (discord calls and screen sharing)
    - Every week in person
- How often they meet, how they meet, and what the goals/outcomes of any meetings so far have been
    - Meetings combined with standups
- Have they or will they try pair programming
    - Splitting into pairs to take on each feature
- Any challenges they've faced already after being in a group for a week
    - not understanding where or how to start

Other group members (in other teams) are encouraged to ask questions and learn from what other groups are doing/saying.

## week_4
**Requirement Activity**
**Q**. What are attributes of good requirements?
**Q**. How could we clean this up into well described requirements? 
>"I want a burger with lots of pickles and mayo but I need to make sure that the mayo doesn't make the burger bun really wet. Oh, and it needs t obe warm, like, made less than 5 minutes ago warm but not so hot that I burn myself. I'm also not a big fan of plastic containers so if it could be in a paper bag that would be good. Actually, make that a brown paper bag, I like the colour of that"

Attributes of good requirements: 
- Flexible
- Detailed
- Easy to understand 
- testable


Borgor with:
**Ingredients**
- lots of pickles
- decent amount of mayo
- bun not wet
**Temperature**
- made more than a minute ago (not too hot)
- made less than 5 minutes ago (not too cold)

**Carrying**
- a brown paper bag

**Code Reviewing activity**
```python=
def check_password(password):
    
    if password == "password" or password == "iloveyou" or password == "123456":
        return "Horrible password"
    elif (len(password) >= 12 and any(x.isupper() for x in password) and
        any(x.isdigit() for x in password) and 
        any(x.islower() for x in password)):
        return "Strong password"
    elif len(password) >= 8 and any(x.isdigit() for x in password):
        return "Moderate password"
    else:
        return "Poor password"
   
if __name__ == '__main__':
    print(check_password("ihearttrimesters"))
    # What does this do? 

```

```python
def check_password(password):
    '''
    Takes in a password, and returns a string based on the strength of that password.

    The returned value should be:
    * "Strong password", if at least 12 characters, contains at least one number, at least one uppercase letter, at least one lowercase letter.
    * "Moderate password", if at least 8 characters, contains at least one number.
    * "Poor password", for anything else
    * "Horrible password", if the user enters "password", "iloveyou", or "123456"
    '''
    horrible_pw = ["password", "iloveyou", "123456"]
    digit = False
    upper = False

    if password in horrible_pw:
        return "Horrible Password"
    elif len(password) >= 8:
        for char in password:
            if char.isdigit():
                digit = True
            elif char.isupper():
                upper = True
        if digit and upper and len(password) >= 12:
            return "Strong Password"
        elif digit:
            return "Moderate Password"
    
    return "Poor Password"

if __name__ == '__main__':
    print(check_password("ihearttrimesters"))
    # What does this do?

```

Compare these two pieces of code from a pythonic, style, and readability point of view and choose which one you prefer. When you choose one, you must justify your reasonining in teh shared documnet your tutor gives you.