Could this script be shortened?
import random
def var():
strength = 10
skill = 10
dice4 = 0
dice12 = 0
dice_score = 0
character_name = ""
attr_list = [character_name, strength, skill]
character_name = str(input("Please enter your characters name: "))
skill_func(strength,skill,dice4,dice12,character_name,dice_score,attr_list)
def skill_func(strength,skill,dice4,dice12,character_name,dice_score,attr_list):
print(character_name + "'s attributes are being generated! ... ")
dice4, dice12 = random.randrange(1,4),random.randrange(1,12)
dice_score = dice12//dice4
skill+= dice_score
print("Skill: ", skill)
strength_func(strength,skill,dice4,dice12,character_name,dice_score,attr_list)
def strength_func(strength,skill,dice4,dice12,character_name,dice_score,attr_list):
dice4, dice12 = random.randrange(1,4),random.randrange(1,12)
dice_score = dice12//dice4
strength+= dice_score
print("Strength: ", strength)
file(attr_list, character_name)
def file(attr_list, character_name):
file = open("attributes.txt", "a")
file.write(character_name + " - Strength = " + str(attr_list[1]) + ", Skill = " + str(attr_list[2]) + "\n")
print("Your scores have been wrote to a file. ")
var()