Please read this explanation before attempting debugging challenges.
My Python code has the wrong output! Help!
import math string = 'hel Lo Myn AmeIsF utIlityh oWARe you?!' def mixup(x): total = 0 newAnswer = '' cut = string.split() mixedCut = cut+cut+cut+cut+cut+cut+cut while x < 10: for char in 'alabaster': total += ord(char) x += 1 spice = mixedCut[total/113] tangerine = mixedCut[total/(70*4)] coldCut = mixedCut[int(total/math.pow(7.29,4))] ham = mixedCut[total/157] icedCream = mixedCut[total/148] alarm = mixedCut[int(total/math.pow(26,2))] herpes = mixedCut[total/176] answer = (spice,tangerine,coldCut,ham,icedCream,alarm,herpes) for char in answer: newAnswer += str(char) print newAnswer mixup(8) print 'The above should read \"WhoAmI?\" but it won\'t!' print 'What could I possibly be doing wrong?'
Downloadable source code can be found here.
You must be logged in to play.