1. Fig-1, 2 depict the Port structure of the ATmega328P MCU of UNO Board.

Figure-1:

Figure-2:
2. IO (input and output) lines are bi-directional.
3. When the directions of the IO lines are not yet determined, then the port names are usually are:
Port-B, Port-C, and Port-D.
The individual IO lines are designated as:
pb0, ..., pb5; pc0, ..., pc5; pd0, ..., pd7
4. When the directions of the IO lines are determined as outputs, then the port names are usually are:
PORTB, PORTC, and PORTD.
The individual output lines are designated as:
PB0, PB1, PB2, PB3, PB4, PB5 or 8, 9, 10, 11, 12, 13
PC0, PC1, PC2, PC3, PC4, PC5 or A0, A1, A2, A3, A4, A5 or 14, 15, 16, 17, 18, 19
PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7 or 0, 1, 2, 3 ,4 ,5 ,6 ,7
Example:
pinMode(8, OUPUT); //PBO will work as output line
bitSet(PORTB, PB0); //HIGH is written on Bit-0 position of PORTB
digitalWrite(8, HIGH); //HIGH is written on Bit-0 position of PORTB
5. When the directions of the IO lines are determined as inputs, then the port names are usually are:
PINB, PINC, and PIND.
The individual input lines are designated as:
PINB0, ..., PINB5 or 8, ..., 13
PINC0, ..., PINC5 or A0, ..., A5 or 14, ..., 19
PIND0, ..., PIND7 or 0, ..., 7
The input lines can be optionally connected with internal pull-up resistor (Rpin = 20k - 50k, Fig-2). It is required to execute the following code:
pinMode(2, INPUT_PULLUP);
Example:
pinMode(7, INPUT); // Bit-7 of Port-D will work as input line without internal pull-up
int n = digitalRead(PIND7); //logic value of Bit-7 of PIND is read into variable n
int n = bitRead(PIND, PIND7); //logic value of Bit-7 of PIND is read into variable n
int n = bitRead(PIND, 7); //logic value of Bit-7 of PIND is read into variable n
int n = digitalRead(7); //logic value of Bit-7 of PIND is read into variable n