My QA Projects

QA Projects I was involded.

View on GitHub

Programming Patterns

Tranform Pattern

Tranform Example

mylist = [1,2,3,4,5,6,7,8]
newlist = []
for n in mylist:
    newlist.append(n ** 2)
print(newlist)

Filter Pattern

Filter Pattern Example

mylist = [1,2,3,4,5,6,7,8]
newlist = []
for n in mylist:
    if n% 2 == 0:
        newlist.append(n)
print(newlist)

# Output
[2,4,6,8]

set into an item in mylist:

Nested Loops

adjectives = ['frozen','cooked','roasted','boiled']
nouns = ['fish','veggies','chicken']

for adj in adjectives:
    # outer loop
    for noun in nouns:
        # inner loop
        print(f"{adj} {noun}", end="\t")
    print()

# Output
frozen fish frozen veggies frozen chicken
cooked fish cooked veggies cooked chicken
roasted fish roasted veggies roasted chicken