Text Generation with Google Gemini

Nov 14 2024 · Python 3.12, Google Gemini, JupyterLab, Visual Studio Code

Lesson 02: Using Google Code Assist

Demo: Using Code Assist Features

Episode complete

Play next episode

Next

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

Demo: Using Code Assist Features

In this demo, you’ll install Code Assist and use its features to complete, explain, and generate code, as well as create unit tests.

def main():

main()
name = "Alice"
print(f"Hello, {name}!")
birthdate = datetime.date(1995, 5, 10)
age = calculate_age(birthdate)
  print(f"You are {age} years old.")

def calculate_age(birthdate):
  today = datetime.date.today()
  age = today.year - birthdate.year
  if today.month < birthdate.month or (today.month == birthdate.month
    and today.day < birthdate.day):
    age -= 1
  return age
import datetime
def main():

main()
numbers = generate_random_list(10)
def main():
    numbers = generate_random_list(10)
    print(numbers)

def generate_random_list(n):
    import random
    numbers = []
    for i in range(n):
        numbers.append(random.randint(1, 100))
    return numbers

main()
sorted_list = numbers.sort()
numbers.sort()
# Print sorted_numbers backwards
result = 10 / 0
See forum comments
Cinema mode Download course materials from Github
Previous: Instruction Next: Conclusion