Beginning with pygame

Hi…to all …today i learnt how to begin with pygame in python

now lets consider getting intensity range of RED,GREEN ,BLUE  inputs from user  and display the resultant colour in window.


#! usr/bin/python
import pygame
from pygame.locals import *
from sys import exit
r=min(255, input("Enter the red colour intensity  :"))
g=min(255, input("enter the green colour intensity : "))
b=min(255, input("enter the blue colour intensity  :"))
pygame.display.set_caption("colour testing ")
while True:
 for i in pygame.event.get():
  if i.type==QUIT:
 screen.fill((r, g, b))

Run the file by python

Window will appear with the resultant color …

Thats it…enjoy coding with pygame….:) Thanks …..:)