Python Collections

In this project, you will master tuples through practical tasks involving the Fibonacci sequence, grayscale image pixel coordinates, and semester records for students. You'll learn to create, modify, access, and iterate over tuples, applying these skills in real-world scenarios to enhance your understanding of this versatile data structure.

All our Data Science projects include bite-sized activities to test your knowledge and practice in an environment with constant feedback.

All our activities include solutions with explanations on how they work and why we chose them.

input

Enter your answer in the input box below as an integer.

input

Find the 12th element of the tuple `fibo_seq`

and enter your answer in the input box below as an integer.

multiplechoice

Are `21`

and `34`

adjacent Fibonacci numbers? Adjacent Fibonacci numbers are two Fibonacci numbers that are next to each other in the sequence. For example, `3`

and `5`

are adjacent Fibonacci numbers, but `3`

and `8`

are not.

codevalidated

The golden ratio is denoted by the Greek letter phi `φ`

. The golden ratio is found by dividing a line into two parts such that the longer part divided by the smaller part is also equal to the whole length divided by the longer part. It is one of the most famous irrational numbers in mathematics. It is also called the divine proportion, the golden mean, or the golden section.

Find the golden ratio using the elements at index 997 and 998 in the tuple `fibo_seq`

and store it in the variable `golden_ratio`

.

codevalidated

Slice the tuple `fibo_seq`

from the 4th index to the 34th index and store it in the variable `thirty_step`

.

codevalidated

Find the maximum Fibonacci number in the tuple `fibo_seq`

and store it in the variable `max_num`

.

Numbers are stored as strings in the tuple

`fibo_seq`

so you need to convert them to integers before finding the maximum.

codevalidated

Find the minimum Fibonacci number in the tuple `fibo_seq`

and store it in the variable `min_num`

.

Numbers are stored as strings in the tuple

`fibo_seq`

so you need to convert them to integers before finding the minimum.

multiplechoice

multiplechoice

In this activity, your task is to determine the value of the coordinate at index 3.

multiplechoice

Find the coordinate of the darkest pixel in the image. The darkest pixel is the pixel with the lowest value.

codevalidated

The records of students in the course `A`

are stored in the tuple `student_data_a`

and the records of students in the course `B`

are stored in the tuple `student_data_b`

. Concatenate the two tuples into one tuple and store it in the variable `combined`

.

codevalidated

Sort the `combined`

tuple so that we will have names in alphabetic order. Store the sorted tuple in the variable `sorted_combine`

.

codevalidated

Count the Students in the `combined`

tuple who have grades above 90. Store the count in the variable `above_90`

.

multiplechoice

multiplechoice

multiplechoice

multiplechoice

multiplechoice

multiplechoice

multiplechoice

```
my_tuple = ("banana","apple", "banana", "cherry","apple","cherry")
len(my_tuple)
```

multiplechoice

```
colors = ("red", "green", "blue")
colors[1]
```

This project is part of

Explore other projects