unity accessing 2d pointlight from c# script

C#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;


public class Lighting : MonoBehaviour
{
    public Light LightSource;
    public float lightIntensity;
    public float minIntensity = 0.35f, maxIntensity = 0.65f;



    void Update()
    {
        lightIntensity = Random.Range(minIntensity, maxIntensity);
        LightSource.intensity = lightIntensity;
    }
}
Source

Also in C#: