Q:

Python turtle throws error when inputting RGB values to bgcolor()

My code throws an error, which, summarized, reads:
"The built-in function for color in Turtle can't do the inequality used in determining color values using both a built-in function of Python and an integer"
from turtle import *

pen = Turtle()
screen = Screen()
screen.colormode(255)
screen.bgcolor('white')

def pen_color(i):
    print("Input a number between 1 and 255 for red")
    red = input
    print("Input a number between 1 and 255 for green")
    green = input
    print("Input a number between 1 and 255 for blue")
    blue = input
    screen.bgcolor(red, green, blue)

pen_color(pen)
pen.exitonclick()

A:

There are several issues with your code:  As @PatrickHaugh notes:
print("Input a number between 1 and 255 for red")
red = input

isn't going to do what you want/expect.  Either do:
print("Input a number between 1 and 255 for red")
red = input()

Or better yet:
red = input("Input a number between 1 and 255 for red")

Next, this won't work as exitonclick() is a method of Screen not Turtle:
pen.exitonclick()

Finally, the reason you're running into problems with color, is that bgcolor() wants numeric argument and you passed it strings.  You need to do:
screen.bgcolor(int(red), int(green), int(blue))

Putting this all together:
from turtle import Screen, Turtle

def pen_color():
    red = input("Input a number between 1 and 255 for red: ")
    green = input("Input a number between 1 and 255 for green: ")
    blue = input("Input a number between 1 and 255 for blue: ")

    screen.bgcolor(int(red), int(green), int(blue))

screen = Screen()
screen.colormode(255)

pen_color()

pen = Turtle()

screen.exitonclick()

