How do I add 'turtle.write' into my code?

Question:
How do I add ‘turtle.write’ into my code

Repl link:
https://replit.com/@jasonthatcher73/Fruit-With-Turtle

import random

# import turtle package 
import turtle 

# making turtle object 
sc = turtle.Screen() 

# setup the screen size 
sc.setup(400,400) 

# set the background color 
sc.bgcolor("blue") 

# This code is contributed 
# by Deepanshu Rustagi.



fruits = ['apple', 'grape']
question_prompt = input('(Y/N)) ')
if question_prompt.upper() == 'Y':
    print('You chose Yes')
else: 
  question_prompt = False  
  print('invalid statement')

# generate a random fruit from the 'fruits' list. 

#if statement for grape
computer_generate = random.choice(fruits)
if computer_generate == 'grape':
  print('\U0001F347') 
else:
#if statement for apple 
  computer_generate = random.choice(fruits) 
if computer_generate == 'apple': 
  print('\U0001F34E')

Hi @jasonthatcher73 , welcome to the forums!
Try replacing all the print() statements with turtle.write().
Hope this helps!

1 Like