Easier ways to make an RPG dice roller code? I'm new to programming and this is the first thing I'm doing on my own. I would appreciate it if you could point me ways to optimize this RPG dice roller code in Python!
import random

def dice_reader():

##this should read messages like '2 d 6 + 3, 5 d 20 + 2 or just 3 d 8'##
    message = input('&gt;')
    reader = message.split(' ')
    times = reader[0]
    sides = reader[2]
    output_with_modifier = []
    result = []

    if len(reader) == 5:
        modifier = reader[4]
    else:
        modifier = 0

    for output in range(int(times)):
        output = random.randint(1, int(sides))
        result.append(output)
        output_with_modifier = [(int(x) + int(modifier)) for x in result]
    print(f' Dice rolls: {tuple(result)}')
    if modifier != 0:
        print(f' With modifier: {tuple(output_with_modifier)}')


    end = False
    while end == False:
        dice_reader()
        end_message = input('Again? ')
        if end_message.lower() == 'no':
            end = True
    else:
        pass
Mystery inputs
It's clear that there's an implied structure to this input:
message = input('&gt;')
reader = message.split(' ')

requiring between four and five tokens. I have no idea what those are, and neither does your user. Replace '&gt;' with an actual description of what's expected here.
Unpacking
times = reader[0]
sides = reader[2]

can be
times, _, sides = reader[:3]

though the discarded second item is suspicious. You do need to show what this is, and it probably shouldn't be there.
Looping and overwrites
This:
for output in range(int(times)):
    output_with_modifier = [(int(x) + int(modifier)) for x in result]

does not make sense. If you ask for 100 times, output_with_modifier will be calculated 100 times and thrown away 99 of them. Only the last value will be kept. You probably want to de-indent that last assignment so that it happens outside of the loop.
More looping
end = False
while end == False:
    dice_reader()
    end_message = input('Again? ')
    if end_message.lower() == 'no':
        end = True
else:
    pass

First, delete that else; pass - it isn't doing anything. Also, end == False should be not end; but you shouldn't be using a termination variable at all. If you find a no, simply break.
Suggested code
Some of this may challenge a beginner, but I like to think that CodeReview is for &quot;aspiring advanced programmers&quot;. I've tried to comment it extensively, but feel free to ask questions in the comments.
import re
from random import randint
from re import Pattern
from typing import ClassVar, Iterable


class Dice:
    &quot;&quot;&quot;
    One specification for dice rolls in Dungeons &amp; Dragons-like format.
    &quot;&quot;&quot;

    def __init__(self, times: int, sides: int, modifier: int = 0):
        if times &lt; 1:
            raise ValueError(f'times={times} is not a positive integer')
        if sides &lt; 1:
            raise ValueError(f'sides={sides} is not a positive integer')

        self.times, self.sides, self.modifier = times, sides, modifier

    # This is a class variable (basically a &quot;static&quot;) that only has one copy
    # for the entire class type, rather than a copy for every class instance
    # It is a regular expression pattern that will allow us to parse user
    # input.
    INPUT_PAT: ClassVar[Pattern] = re.compile(
        # From the start, maybe some whitespace, then a group named &quot;times&quot;
        # that contains one or more digits
        r'^\s*(?P&lt;times&gt;\d+)'    
        
        # Maybe some whitespace, then the letter &quot;d&quot;
        r'\s*d'
        
        # Maybe some whitespace, then a group named &quot;sides&quot; that contains one
        # or more digits
        r'\s*(?P&lt;sides&gt;\d+)'
        
        # The beginning of a group that we do not store.
        r'(?:'
        
            # Maybe some whitespace, then a &quot;+&quot; character
            r'\s*\+'
        
            # Maybe some whitespace, then a group named &quot;modifier&quot; that
            # contains one or more digits
            r'\s*(?P&lt;modifier&gt;\d+)'
        
        # End of the group that we do not store; mark it optional
        r')?'
        
        # Maybe some whitespace, then the end.
        r'\s*$',

        # We might use &quot;d&quot; or &quot;D&quot;
        re.IGNORECASE
    )

    # This can only be called on the class type, not a class instance. It
    # returns a new class instance, so it acts as a secondary constructor.
    @classmethod
    def parse(cls, message: str) -&gt; 'Rolls':
        match = cls.INPUT_PAT.match(message)
        if match is None:
            raise ValueError(f'Invalid dice specification string &quot;{message}&quot;')

        # Make a new instance of this class based on the matched regular
        # expression.
        return cls(
            int(match['times']),
            int(match['sides']),
            # If there was no modifier specified, pass 0.
            0 if match['modifier'] is None else int(match['modifier']),
        )

    @classmethod
    def from_stdin(cls) -&gt; 'Rolls':
        &quot;&quot;&quot;
        Parse and return a new Rolls instance from stdin.
        &quot;&quot;&quot;

        while True:
            try:
                message = input(
                    'Enter your dice specification, of the form\n'
                    '&lt;times&gt;d&lt;sides&gt; [+ modifier], e.g. 3d6 or 4d12 + 1:\n'
                )
                return cls.parse(message)
            except ValueError as v:
                print(v)
                print('Please try again.')

    def roll(self, with_modifier: bool = False) -&gt; Iterable[int]:
        &quot;&quot;&quot;
        Return a generator of rolls. This is &quot;lazy&quot; and will only execute the
        rolls that are consumed by the caller, because it returns a generator
        (not a list or a tuple).
        &quot;&quot;&quot;
        mod = self.modifier if with_modifier else 0
        return (
            randint(1, self.sides) + mod
            for _ in range(self.times)
        )

    def print_roll(self):
        print(
            'Dice rolls:',
            ', '.join(str(x) for x in self.roll()),
        )

        if self.modifier != 0:
            print(
                'With modifier:',
                ', '.join(str(x) for x in self.roll(with_modifier=True)),
            )


def test():
    &quot;&quot;&quot;
    This is an automated test method that does some sanity checks on the Dice
    implementation.
    &quot;&quot;&quot;
    
    d = Dice.parse('3 d 6')
    assert d.times == 3
    assert d.sides == 6
    assert d.modifier == 0

    d = Dice.parse('3D6 + 2')
    assert d.times == 3
    assert d.sides == 6
    assert d.modifier == 2

    try:
        Dice.parse('nonsense')
        raise AssertionError()
    except ValueError as v:
        assert str(v) == 'Invalid dice specification string &quot;nonsense&quot;'

    try:
        Dice.parse('-2d5')
        raise AssertionError()
    except ValueError as v:
        assert str(v) == 'Invalid dice specification string &quot;-2d5&quot;'

    try:
        Dice.parse('0d6')
        raise AssertionError()
    except ValueError as v:
        assert str(v) == &quot;times=0 is not a positive integer&quot;

    d = Dice.parse('100 d 12+3')
    n = 0
    for x in d.roll(True):
        assert 4 &lt;= x &lt;= 15
        n += 1
    assert n == 100


def main():
    test()

    dice = Dice.from_stdin()
    dice.print_roll()


if __name__ == '__main__':
    main()