I'm new to JES and I'm stuck on this, I'm sure my coding is wrong. If I entered my age as 21 I want the 2 allocated to variable a and 1 allocated to variable b.
Any help would be most appreciated.
def makeSound():
picture=makeEmptySound(10 * 22050)
number = requestNumber("Enter Your Age:")
a = String('number[1]')
b = String('number[2]')
setMediaPath("c:\")
file = getMediaPath(str(a) + str(b) + ".wav")
Indexes into sequence-types like
str
are zero-based in Python, so assumingrequestNumber()
returns afloat
, you'll need to convert it to astr
and then you can do: