def reject():
print("get out!")
quit()
import random
print("chooses random dice rolls")
maximumval=int(input("how many dice rolls do you want?"))
if maximumval<0:
reject()
else:
counter=1
while counter<=maximumval:
counter=str(counter)
mydict={
}
val=random.randint(1,7)
val=str(val)
mydict.update({counter:val})
val=int(val)
counter=int(counter)
counter+=1
print(mydict)
it gives parseError on line 17
I was not able to solve it. It says parseError.
Indentation in python is crucial for code blocks. It seems like you have extra spaces in front of all rows between row
17(val=random.randint(1,7)) and21(counter=int(counter)) including both edges. Remove the extra spaces and you should be good to go.Fixed code:
Consider using an IDE/Text Editor like vscode with the correct extensions this will help you identify such mistakes.