I'm working with a larger program, but what I'm really struggling with is printing the result of simple math expressions. It doesn't seem necessary that I have to assign them to a variable. I have tried a few combinations of print
/ int
/ str
.
I've looked at the following questions:
- Print out math expression contained within variable
- How do I print the results of my math of my functions? [python functions] (edited)
- How to evaluate a math expression given in string form?
- basic math rotation, wrong results
I've also done several searches.
list_options = ("hammer", "rope", "blanket", "sunglasses")
print (list_options)
print()
r1 = len(list_options)
r2 = (random.randint(1, r1) +1)
print(r1)
print(r2)
print()
print ("Python range is 1 to " + r2 + "Technically range is 1 to " )
print(int(r2-1))