Is it possible to assign many pins to one variable?

The other way to do this is with bit-fiddling on the ports.

Ports vary from board to board, and so it's usually not a good way to go about things. But it will work.

On the UNO, PORTD corresponds to pins 0-7 and PORTB corresponds to pins 8-13.

Lets say that you are using pins 6 to 12 for your seven-segment output. If you put

0b11000000 into PORTD, and 0b11111 into PORTB, this will turn on all your seven segment pins. Unhapilly, it will also turn off all the other pins in the range 0-13. What you need to do is to turn on some bits without turning off others. To do this, you use the C++ bitwise operators. To turn off a bit, you AND a value with something that has all the bits on except the one you want. To turn on a bit, you OR it with the bits you want.

So to turn off all the bits of your seven segment display, you need to

PORTD = PORTD & ~0b11000000;
PORTB = PORTB & ~0b11111;

Remember - this is only correct on a UNO.

So how to you get the thing to display a '1'? Well, lets say that to display a '1' you want pins 6 and 11 to be on, and all the rest off. Pin 6 is the fifth bit of PORTD, and pin 11 is the fourth bit of PORTB. The handy way to get these two values is by left-shifting a single bit. 1<<4 and 1<<3 are the two numbers you need.

Putting it altogether

const byte PORTD_MASK = 0b11000000;
const byte PORTB_MASK = 0b11111;

const byte PORTD_MASK_ONE = 1<<4;
const byte PORTB_MASK_ONE = 1<<3;

void display_ONE() {
  PORTD = (PORTD & PORTD_MASK) | PORTD_MASK_ONE;
  PORTB = (PORTB & PORTB_MASK) | PORTB_MASK_ONE;
}

Now, you may feel that this is more trouble than it's worth. And you'd be right. This is why everyone uses digitalWrite() unless there is a pressing need for your port writes to be microsecond fast. But - yes, it's possible to write multiple pins simultaneously.