Draw This - beginner
Look at the number sequence: 2, 4, 8, 16, 32. Draw a flowchart that shows how to find the next number in this pattern.
Look at the number sequence: 2, 4, 8, 16, 32. Draw a flowchart that shows how to find the next number in this pattern.
+-------+
| Start |
+-------+
|
v
+-----------------+
| Input last number|
+-----------------+
|
v
+---------------------+
| Multiply number by 2 |
+---------------------+
|
v
+-----------------+
| Output next num |
+-----------------+
|
v
+-----+
| End |
+-----+This flowchart starts by taking the last number in the sequence as input. Then it multiplies that number by 2, because each number in the pattern is double the previous one. Finally, it outputs the next number and ends. This matches the pattern 2, 4, 8, 16, 32 where each number is twice the one before.
data = [2, 4, 6, 8, 10]
result = []
for num in data:
if num % 4 == 0:
result.append(num)
print(result)numbers = [1, 2, 3, 4, 5]
even_nums = []
for n in numbers:
if n / 2 == 0:
even_nums.append(n)
print(even_nums)words = ['apple', 'banana', 'apricot', 'berry', 'avocado']. You want to create a new list containing only words that start with 'a' using pattern recognition. Which code snippet correctly does this?Pass the test and this pattern moves unknown