The console prints a list of items for the user to scroll through using the up and down arrow keys I am somewhat new to python (yes I know, a cliché statement) and I wrote this code to scroll through a tuple of strings using the arrow keys. I know that the code is sloppy but I don't know how. Any feedback would be greatly appreciated.
import keyboard
from os import system
from time import sleep


class Menu:
    def __init__(self, *items):
        self.items = items
        self.selections = 6
        self.start = 0
        self.stop = self.start + self.selections
        self.slice = items[self.start:self.stop]
        self.selected = 0
        self.beg = '&gt;'
        self.end = '&lt;'

    def get_input(self):
        if keyboard.is_pressed('up'):
            if self.selected &gt;= 0:
                self.selected += -1
            self.show()
        elif keyboard.is_pressed('down'):
            if self.selected &lt; self.selections:
                self.selected += +1
            self.show()

    def show(self):
        system('cls')

        # shift slice up if the bottom of list is reached
        if self.selected == self.selections:
            if self.stop &lt; len(self.items):
                self.start += 1
                self.stop += 1
                self.slice = self.items[self.start:self.stop]
            self.selected = self.selections-1

        # shift slice down if top of list is reached
        elif self.selected &lt; 0:
            if self.start &gt; 0:
                self.start += -1
                self.stop += -1
                self.slice = self.items[self.start:self.stop]
            self.selected = 0

        # print the slice with the selected item printed like &gt;this&lt;
        for i in range(len(self.slice)):
            if i == self.selected:
                print(self.beg + self.slice[i] + self.end)
            else:
                print(self.slice[i])


test_menu = Menu('item 0',
                 'item 1',
                 'item 2',
                 'item 3',
                 'item 4',
                 'item 5',
                 'last item')
test_menu.show()


while 1:
    test_menu.get_input()
    sleep(0.1)
get_input should be called handle_input. get_input suggests that it returns input values, whereas really, it's a &quot;step&quot; function used to handle what's going on at a slice in time.
Also in that function, self.selected += -1 is confusing. Why add a negative number instead of subtracting? I would change that and the other similar instances to self.selected -= 1. Personally, I'd also get rid of the prefix + in +1. I don't find it adds anything.

Sorry, I wrote another review before this and my brain's tired. Hopefully someone else can give better suggestions.