Wishing to change KeyCode from public variable.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class fireC : MonoBehaviour {
public GameObject missile = null;
public string shoot = “F”;
// I think public string variable type is the problem. There isn’t an dictionary for Unity C#?
void Update () {
if(Input.GetKeyDown(KeyCode.shoot)){
GameObject shot = GameObject.Instantiate(missile, transform.position, transform.rotation);
}
}
}

Does this not work?

public KeyCode shoot = KeyCode.F;
if(Input.GetKeyDown(shoot)) {
    ...