Hot answers tagged

4 votes

credit - Why this AMEX and MASTERCARD numbers are considered invalid?

Found it: American Express starts with 34 or 37, Master Card starts with 51, 52, 53, 54 or 55. This makes those two numbers INVALID despite good checksum :)
user avatar
  • 153
3 votes
Accepted

cs50 problem set 1 mario. check50 command returns error: 'You seem to be missing these required files: mario.c'

You MUST be in the same directory as the source code to run check50 and submit50. It doesn't work if you're not. The parameter isn't about where the code is located, it's about which tests to run. ...
user avatar
  • 63.4k
3 votes
Accepted

Why can't I print the entire string from the read file?

I guess you meant print(dna[i:i+len("AGATC")]). In Python, if the end of the substring is before the beginning, the substring is empty, so you are printing a bunch of empty strings.
user avatar
  • 20.7k
2 votes
Accepted

PSET3 runoff 2020

1) Because I can't modify the header, how can I use strcmp (hints ask for) without string.h ? You can include string.h as per the spec: (and the inclusion of additional header files, if you’d like)...
user avatar
1 vote
Accepted

DNA code doesn't work sometimes

Ok, I`ve found the bug. It came out, that my code wasn't comparing the current sequnce lenth with the previous maximum, but just increased 'counter' value, if the STR lenth was greater than 1. It ...
user avatar
1 vote

PSET3 runoff 2020

The file name would likely be a typo :) It's ok to add header includes to runoff.c. I guess that sentence got refactored a bit, and the part in parentheses should be moved to the where-to-change part ...
user avatar
  • 20.7k

Only top scored, non community-wiki answers of a minimum length are eligible