Trending questions

0 votes
1 answer
34 views

CS50P "Lines of code"

Assignment: "file called lines.py, implement a program that expects exactly one command-line argument, the name (or path) of a Python file, and outputs the number of lines of code in that file, ...
Kevin's user avatar
  • 1
0 votes
1 answer
10 views

"Correct numb3rs.py passes all tests" not checked in the check50: numb3rs.py cs50

I am implementing the code for IPv4numb3rs problem. The code works as expected and the test code too but I don't get why the the "correct nub3rs.py passes all test_numb3rs.py check" isn't ...
Grace 's user avatar
  • 39
0 votes
1 answer
4 views

mario more in c - help!

Down below my code. I'm able to print the left part of the pyramid but the right part doesn't come up. What do I do wrong? #include <stdio.h> #include <cs50.h> #include <stdio.h> #...
Lisa Smit's user avatar
0 votes
1 answer
14 views

cs50p lines.py not passing the last 3 tests

from sys import argv,exit def main(): try: if len(argv) < 2: exit("Too few command-line arguments") elif len(argv) > 2: exit("Too many ...
Hari's user avatar
  • 1
0 votes
1 answer
8 views

General Doubt regaring CS50 Course

I knew that, CS50 provides the course completion certificate after we complete any course of CS50 by submitting all the assignments and projects provided with atleast 70% score. Is this same policy ...
Maniram Tatipamula's user avatar
0 votes
1 answer
6 views

Project0 P2 Raise exception

I have 2 questions: 1. Can I invoke a function within the definition of another function? Since to define result() we need to check it's which player's move, I feel the need to use player() here. 2. ...
Skywalker's user avatar
0 votes
0 answers
12 views

i have an error in debug50

When i try to debugging my code with debug50 it gives me this message even though it compiled (The preLaunchTask 'C/C++: gcc build active file' terminated with exit code -1.) + it happens in some ...
elfawall's user avatar
0 votes
2 answers
32 views

PLEASE HELP!!! STUCK ON SPELLER FOR MORE THAN A MONTH NOW

Link to post on Reddit I started working on the pset last month, coded all the required functions (at least I thought I did) and check50 surprised the #&*# out of me, none of the checks were ...
sanya_timi's user avatar
0 votes
1 answer
8 views

Unable to generate GUI in cs50-customized IDE (Offline, Local with VS Code, Docker Container)

I've been using the offline version of CS50.dev (in VS Code with docker container, offline, as instructed in the cs50 documentation). It is really convenient and I enjoy it. However, when I want to ...
Shiba's user avatar
  • 1
0 votes
2 answers
34 views

cs50 pset 1 credit.c not outputting correct answers in certain random(?) cases

My code works fine for most of cs50's checks except all AMEX card type checks and some VISA type checks where it just outputs INVALID instead of the actual answer. #include <cs50.h> #include <...
FriedToast's user avatar
-1 votes
3 answers
26 views

My convert function is broken and not passing tests but my program seems to do what i think it should

def main(): time= input("What time is it?: ") hour, min= time.split(":") if "a.m." in time: Min, t= min.split(" ") if 7 <= ...
Om Prakash Sahu's user avatar
0 votes
0 answers
14 views

pls! why ai made bool alternate = false and alternate != alternate and it can just make true instead of false

bool luhn_algorithm(long number) { int sum = 0; bool alternate = false; while (number > 0) { int digit = number % 10; if (alternate) { digit *= ...
elfawall's user avatar
0 votes
0 answers
29 views

pset1 cs50ai: tic-tac-toe, TypeError: 'NoneType' object is not subscriptable error at minimax function

I am stuck at implementing the minimax function with alpha-beta pruning. This is were I'm at: def minimax(board): _, value = best_move(board) if value == None: return None else: ...
Margarita's user avatar
0 votes
1 answer
89 views

Why is it not possible to print a `string` returned by this function?

In the assignments Caesar and Substitution of Problem Set 2 of the CS50 course, students often attempt to create a separate function which enciphers the plaintext and returns the ciphertext as a ...
Andreas Wenzel's user avatar
0 votes
1 answer
10 views

When trying to implement the blur function in pset4, the image ends up blurred, but with odd star shapes in the middle of the image

void blur(int height, int width, RGBTRIPLE image[height][width]) { RGBTRIPLE copy[height][width]; // Declares a copy of the array, so that the blurred pixels aren't affected by already blurred ...
ConorNE's user avatar

15 30 50 per page
1
2 3 4 5
906