I'm making an RPG and I'd like to call up a character sheet function. I've stored the stats in a list, and I'm trying to put them in the sheet:
global char
char = ["Name" , 100,100,30,30]
def sheet():
global char
print("Character sheet: \nName: {} \nHP: {}/{} \nMP: {}/{}".format(char[0:])
I expected it to come out like this:
Character sheet:
Name: Name
HP: 100/100
MP: 30/30
But it ends up with an error:
Tuple index out of range
I realize I could do it separately,
print("print("Charecter sheet: \nName: {} \nHP: {}/{} \nMp: {}/{}".format(char[0],char[1],...)
But I'd be interested in other ways to make my code look cleaner.