« first day (1752 days earlier)      last day (1589 days later) » 

9:48 AM
that's need @AndrasDeak attention so
 
1 message moved from Python
 
 
9 hours later…
6:30 PM
I really just turned the input into a dictionary, then iterated over it and incremented a var each time, using the value of each key as the next key to go from satellite to satellite to the COM.
 
6:41 PM
As I said, more than slightly surprised this idea worked.
MOre or less the same concept for the second part, take each satellite (YOU, SAN) and iterate over the objects it orbits - start with inputs['YOU'], adding one to the distance each time, storing the object name and distance in a dict. Then find the common objects between YOU/SAN, and find the lowest number of the sum of the distances from YOU/SAN to each of the objects.
There didn't seem to be too many gotchas today, hence why I was about 12 hours earlier than yesterday but still only around 12th on our leaderboard.
 
I did roughly the same thing as you although I think we stored our data differently
 
time is irrelevant, those are smart solutions
 
@Kevin Yeah mine wasn't recursive functions ;) which might have been a problem for a large dataset, no?
 
5 messages moved from Python
1 message moved from Python
 
 
3 hours later…
10:02 PM
location = input('Insert Location: ')
if len(location) < 1 and not location.isdigit() == True:
    print('Please Insert Valid Location')
what's wrong here?
 
@αԋɱҽԃαмєяιcαη you tell us
 
@AndrasDeak seriously :O
 
for one and not location.isdigit() == True is an antipattern
 
@αԋɱҽԃαмєяιcαη like seriously. You tell what's wrong there.
you come here with an excerpt of code because you know it to be wrong... for some reason... and you ask us why it is wrong. We're not here to solve your riddles.
 
@AnttiHaapala well thanks for your answer. i post it for all. not for specific one. so if you not that one who advise. so another will be
 
10:09 PM
@αԋɱҽԃαмєяιcαη You're asking us what is wrong, which suggests that you've gotten some kind of error when you were running whatever code this snippet is from. How are we supposed to know what you did wrong if you don't tell us what actually went wrong during execution.
is len('0') < 1?
 
also not location.idigit()
 
but am not comparing for the len of 0
 
0/2?
@αԋɱҽԃαмєяιcαη juts fire up a python shell and play around with s = '0', checking len(s) and len(s) < 1 etc., separately
 
@KieranMoynihan am trying to say that the length of location should not be < 1 so the user will not press enter and pass.
and in same time i want to tell the location should not included numbers
 
10:30 PM
@AndrasDeak i know that len('0') is equal to 1 so that's why i was trying to put the second part which check the string if it's number or not.
 
@αԋɱҽԃαмєяιcαη You probably "know" everything that's needed here, yet your code has a bug, so you must have a false assumption somewhere. Either you can try to convince us that this is not the case, or go and try to actually debug your broken code.
 
@AndrasDeak you are right. this room for people like you.
 
10:48 PM
location = input('Insert Location: ')
if all(i.isalpha() or i.isspace() for i in location):
    print('You can continue')
else:
    print('Please Insert Valid Location')
that's what i was want to achieve .
 
21 messages moved from Python
 

« first day (1752 days earlier)      last day (1589 days later) »