https://gemini.google.com/Agree to any conditions that pop up.
At the bottom, in the "Enter a prompt here" field, enter this prompt:
Write Python code to count from 1 to 10 and run it.
Gemini writes the code, and explains how it works,
as shown below.
Click the up-arrow icon, and click "Export to Colab", as shown below.
A box pops up, saying "New notebook saved in Drive." Click "Open Colab".Colab opens, with both the code and the explanation, as shown below.
Click the run button on the left side of the code box, outlined in red in the image below.
ML 131.1: Product (5 pts)
Carefully modify the code to match the image below. Make sure the indentation of the lines you add is correct.Run that code.
The flag is covered by a green rectangle in the image below.
ML 131.2: Primes (10 pts)
In Gemini, on the left, click "Reset chat". Click Reset.In Gemini, enter this prompt:
Export the code to Colab and run it.Write Python code to generate the first ten prime numbers. Include only every other result. Multiply the remaining numbers together. Display the original list of primes, the list with only every other number included, and the resulting product.
The code fails, as shown below.
Fix the code to see the flag, covered by a green rectangle in the image below.
ML 131.3: Fibonacci (10 pts)
Generate the first ten Fibonacci numbers, excluding the first one. As you did above, multiply every other one together to see the flag, covered by a green rectangle in the image below.
ML 131.4: 1000 Primes (15 pts)
Generate the first 1000 prime numbers. Add every hundredth one together. The flag is covered by a green rectangle in the image below.
Posted 7-5-23
Title changed 7-24-24