Python code Explanation

Tell us what’s happening:
Hey campers,
I am doing this time calculator challenge and I get this error:

 value error: not enough values to unpack (expected 2, got 1)

Also seems there are some flaws in the logic of my code:

def add_time(start, duration):

  starting = start.split(" ")
  num = starting[0]
  form = starting[1]
  starttime = num.split(':')
  hours = starttime[0]
  mins = starttime[1]
  addedtime = duration.split(':')
  addedhrs = addedtime[0]
  addedmins = addedtime[1]
  tothrs = hours + addedhrs
  totmins = mins + addedmins

  if(form == 'PM' or form == 'AM'):
    count, totalhrs =  get_count(tothrs), 
    days = get_days(tothrs)

    exists = timeFormat(totmins) 
    if exists:
          totalhrs = totalhrs + 1  # Edge case

    if count != 0 and count % 2 != 0:
        if form == "AM": 
          form = "PM"
        else:
          form = "AM"       
    if days != 0:
      return '%s:%s %s (%s days left)' % (totalhrs, totmins, form , days)
    else:
      return '%s:%s %s' % (totalhrs, totmins, form)
  

def timeFormat(mins):
 hr = False
 if(mins > 60):
      hr = True 
 return hr

def get_count(tothrs):
 count = 0
 while (tothrs > 12) :
     tothrs = tothrs - 12
     count = count + 1
 return count, tothrs     

def get_days(tothrs):
  days = 0
  while (tothrs > 24) :
      tothrs = tothrs - 24
      days = days + 1
  return days   

Challenge: Time Calculator

Link to the challenge:

If you can post a live project (repl.it, etc.) we can run and look at the test results and error messages, that would be best.

When I pulled your code into my copy of the project, I noticed the indentation was inconsistent as most of the indentation was at 2 spaces instead of 4 (repl.it does this by default unfortunately). Once I fixed that, I noticed that you have string/int comparison issues due to

def add_time(start, duration):

    starting = start.split(" ")
    num = starting[0]
    form = starting[1]
    starttime = num.split(':')
    hours = starttime[0]
    mins = starttime[1]
    addedtime = duration.split(':')
    addedhrs = addedtime[0]
    addedmins = addedtime[1]

this data not being converted to int before being used in calls to your functions like get_count(tothrs), which does integer comparisons and arithmetic and is being passed strings.

Once you get the indentation fixed (4 spaces per level) and convert your strings to integers, you will get more meaningful output and error messages.