enter and remember multiple numbers | Sololearn: Learn to code for FREE!

0

enter and remember multiple numbers

I'm trying to get a code that holds multiple inputs and keeps track of them. i.e. character stats for a dice roller random roll + stats = roll but I cant get the imputs to go in can anyone help? s = input("Enter Strenght stat") print("." + s + ".") c = input("Enter Constitution stat") print("." + c + ".") d = input("Enter Dexterity stat") print("." + d + ".") w = input("Enter Wisdom stat") print("." + w + ".") i = input("Enter Inteligence stat") print("." + i + ".") ch = input("Enter Charisma stat") print("." + ch + ".") print("." + s + c + d + w + i + ch + "."')

2/14/2019 12:18:45 AM

Braxton

1 Answer

New Answer

+5

I'm not sure I understand what you want to achieve by "random roll + stat = roll" What did you expect the stats be? numbers? string? if you want numbers then use int(input(...)) because input() function returns a string and if you want to, later, you can't easily do straight calculation with string. And can you elaborate more about your plan with those stats? why you need to keep track of them? as for keeping the values, you can use a list for storage. s = int(input("Enter Strenght stat")) print("." + s + ".") c = int(input("Enter Constitution stat")) print("." + c + ".") d = int(input("Enter Dexterity stat")) print("." + d + ".") w = int(input("Enter Wisdom stat")) print("." + w + ".") i = int(input("Enter Inteligence stat")) print("." + i + ".") ch = int(input("Enter Charisma stat")) print("." + ch + ".") values = [ s , c , d , w , i , ch ] print(values)