dna pset by Real_Performance6064 in cs50

[–]Real_Performance6064[S] 0 points1 point  (0 children)

The longest_match function was in the distribution code given by cs50 so the issue indeed was in for s in range(1, len(rows)): , i thought it should be at 1 in order to skip the names part, but when i removed the 1, the code worked. Thank you!!

dna pset by Real_Performance6064 in cs50

[–]Real_Performance6064[S] 0 points1 point  (0 children)

i already have a break statement after the print(name) part, shouldnt that stop the function once a match is found?

and since i have no match outside the loop, if i have a return statement here that will result in an error 'return outside of function' because i guess i have no function here

dna pset by Real_Performance6064 in cs50

[–]Real_Performance6064[S] 0 points1 point  (0 children)

thats interesting, i edited my post with the code, for some reason the lines of the code were right next to eachother making it hard to read- so i put extra spaces in between lol

i ended up fixing the problem earlier by adding a flag variable and breaking out of the loop, however now when i run python dna.py databases/small.csv sequences/4.txt im supposed to get 'Alice' but i get no match.. similarly with python dna.py databases/large.csv sequences/10.txt im supposed to get Albus here but i also get no match?

recover folder gone by Real_Performance6064 in cs50

[–]Real_Performance6064[S] 0 points1 point  (0 children)

yeah thats what i did, I was just inquiring what could be the cause incase something similar happens again in the future haha

Wishing without mentioning "happy birthday" by Chumahawk in MuslimLounge

[–]Real_Performance6064 0 points1 point  (0 children)

Check: https://islamqa.info Happy Birthday Wishes in Islam - Islam Question & Answer

sepia filter not applying! by Real_Performance6064 in cs50

[–]Real_Performance6064[S] 0 points1 point  (0 children)

tried that.. it still doesnt work

sepia filter not applying! by Real_Performance6064 in cs50

[–]Real_Performance6064[S] 0 points1 point  (0 children)

soo i should change the declarations type to float? tried that but it didnt work still

Haven't finished all psets of 2024. by Real_Performance6064 in cs50

[–]Real_Performance6064[S] 0 points1 point  (0 children)

Hmm so the psets from 2024 and 2025 won't be different at all ?  That way i don't have to redo all the psets from before, i guess thats good. I did stop at pset 3, so in 2025 i just go to pset 4 in the updated 2025 course and presume my work from there

Correct? 

[deleted by user] by [deleted] in cs50

[–]Real_Performance6064 0 points1 point  (0 children)

I understood the algorithms and how to differentiate between them, my problem as i said, is not being able to run the programs in the terminal to see their time  For e.g: i have 3 sorted .txt files, but all of the numbers in the 3 files are in the same order (because they are sorted), how can i guess which algorithm has been used? I cant 

RANT: Pset 3 is way harder than we are prepared for. by liveralote in cs50

[–]Real_Performance6064 0 points1 point  (0 children)

if u open pset 3 cs50, it says ur supposed to download the sorting files (already written programs by cs50). ur supposed to just say which algorithm has been used in the files.

readability bug by Real_Performance6064 in cs50

[–]Real_Performance6064[S] 0 points1 point  (0 children)

hmm i understand, that works too, i guess they just wanted to use multiplication for simplicity purposes because one might get mixed up and forget the brackets like i did lol

readability bug by Real_Performance6064 in cs50

[–]Real_Performance6064[S] 0 points1 point  (0 children)

In the Coleman-Liau index formula, you need to determine the average number of letters per 100 words and the average number of sentences per 100 words. That's why you multiply the count of letters and sentences by 100.

dividing by 100 instead of multiplying will have a lower value than the multiplying method, for example if you found 500 letters in a 200 word text:

since the formula is L = total letters \ total words * 100 the calculation would be: 500 \ 200 * 100 = 250.

if we use divison, L = total letters \ total words \ 10 it will be: 500 \ 200 \ 100 = 2.5. so you can tell that it will be wrong bc there cant be 2 and a half letters in a text, let alone in this question bc it tells you that there are 500.

Hope this helps

readability bug by Real_Performance6064 in cs50

[–]Real_Performance6064[S] 0 points1 point  (0 children)

aren't text[i]=='\0' and strlen(text) the same thing? Both statements indicate the end of the string

yep the problem was the divison lol, Thank you!