This is my whole program I'm working on (with the function not in the right place due to the code needing to be indented) but anyway there is a problem that I'm not sure how to fix.
How do I change it so that this would work along with my program? It says that it is in a string but am not sure how to change this so it calculates the variables from the rest of my program. I am sorry seeming how this is not the only problem I am new to this and am just getting used to how this works.
import time
import randomdef welcome():
ready="no"
while ready=="no":print("Welcome To Encounter Simulator Inc. Where We Provide You with combat..")print("Readying Start Up Sequence....")time.sleep(0.5)print("Welcome Are You Ready? Yes or No")ready=input(str())
while ready!="yes" and ready!="no":print("Yes or No Please")ready=input(str())def name():
areyousure="no"
while areyousure!="yes":print("What do you want your 1st character to be named?")name=input()print("Are You Sure?(yes or no)")areyousure=input(str())
if areyousure!="yes" and areyousure!="no":print("Yes or No Please")areyousure=input(str())
return namedef name2():areyousure2="no"while areyousure2!="yes":print("What do you want your 2nd character to be named?")name2=input()print("Are You Sure?(yes or no)")areyousure2=input(str())if areyousure2!="yes" and areyousure2!="no":print("Yes or No Please")areyousure2=input(str())return name2def inputtingfor1(name):
areyousure3="no"
while areyousure3!="yes":print("Please Input",name,"'s Attributes..")skill1=input("The Skill Attribute= ")strength1=input("The Strength Attribute= ")print("Are You Sure? (Yes or No)")areyousure3=input(str())
return skill1,strength1def inputtingfor2(name2):
areyousure4="no"
while areyousure4!="yes":print("Please Input",name2,"'s Attributes..")skill2=input("The Skill Attribute= ")strength2=input("The Strength Attribute= ")print("Are You Sure (Yes or No)")areyousure4=input(str())
return skill2,strength2def difference1(skill1,skill2):
if skill1 >= skill2:result0=skill1-skill2result1=result0/5
elif skill1==skill2:print("There Will Be No Skill Modifier")result1=0
else:result0=skill2-skill1result1=result0/5
return result1def difference2(strength1,strength2):
if strength1 >= strength2:result10=strength1-strength2result2=result10/5
elif strength1==strength52:print("There Will Be No Strength Modifier")result2=0
else:result10=strength2-strength1result2=result10/5
return result2def dicerolling1():
print()
time.sleep(1)
print("This Will Determin Who Gets The Modifiers And Who Loses Them..")
dicenumber1=random.randint(1,6)
print(" The Dice Is Rolling For",name1,)
time.sleep(1)
print("And The Number",name1,"Got Was...",dicenumber1,)
return dicenumber1def dicerolling2():
print()
time.sleep(1)
print("This Will Determin Who Gets The Modifiers And Who Loses Them..")
dicenumber2=random.randint(1,6)
print(" The Dice Is Rolling For",name2,)
time.sleep(1)
print("And The Number",name2,"Got Was...",dicenumber2,)
return dicenumber2welcome()
name=name()
name2=name2()
skill1,strength1=inputtingfor1(name)
skill2,strength2=inputtingfor2(name2)
difference1(skill1,skill2)
difference2(strength1,strength2)
dicenumber1=dicerolling1()
dicenumber2=dicerolling2()