Can integer values be assigned to I/O prts?

I just recently retired & I'm anxious to get an Arduino & start learning how to use it.

Can I assign random integer values to the I/O ports?

What I want to do is use the Random function to create a random brightness value between 0 & 255 & assign it to an LED that's connected to an I/O port on the Arduino. Can I use the Random function to randomly choose I/O ports?

This might be of interest:

You want to randomly pick the PWM capable IO port (a byte value) that will have a random 0-255 (also a byte value) written to it? I suppose so.

Something like:

  analogWrite (pin_table [random (4)], random (256)) ;

where pin_table maps 0..3 to 4 PWM pin numbers?

You consfuse "pin" and "port" - a pin is a single logic signal, a port is a group of pins controlled by the same internal registers on the microcontroller - the Arduino functions hide ports from you, you don't need to know about them if you don't want to.

yes, with byte pin_table[] = {3,5,6,9,}; // 10, 11 also available on an Uno for example.