
January 21st, 2013, 08:39 PM
|
|
Registered User
|
|
Join Date: Jan 2013
Posts: 5
Time spent in forums: 2 h 27 m 26 sec
Reputation Power: 0
|
|
|
Python help [Solved]
Sorta a newbie
Return a string of the form 'car 1,car 2, car <count>'.
However, if the count is 6 or more, then use the string 'and <num> more cars' as the last item instead of the actual list of donuts
This is what I have so far but it does not produce the results I want correctly.
Code:
def cars(count):
if count >= 6:
count -= 4
numcars = 'and ' + str(count) + ' more cars'
else:
numcarts = 'car ' + str(count)
return numcars
I SOLVED IT (The long way, but still figured it out nonetheless :P)
|