1
Razakii
6y

Can someone help me with the python code in this picture, I'm a first year in college and it's meant to be a while loop and I can't seem to get it

Comments
  • 3
    do you mean something like that?

    memberSize = input("How many members of the band?")

    bandNames = []
    instrumants = []

    i = 0
    while i < memberSize:
    x = raw_input("What is band members #"+ str(i+1) + "'s name?")
    bandNames.append(x)
    x = raw_input("What is "+ str(bandNames[i]) + " instrument?")
    instrumants.append(x)
    i = i+1

    print "Band members"
    print "-------------------"
    i = 0;
    while i < memberSize:
    print str(i+1) + ": " + str(bandNames[i]) + " - " + str(instrumants[i])
    i = i+1
  • 0
    Two vocals and drums? I would not pay for that.
Add Comment