Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options questions only not deleted user 40802

Code using the python language.

0 votes
2 answers
424 views

question in CS50P course on lines.py

I have this assignment: "In a 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 … And I wrote this python code: ###problem_set_6 --> lines.py import sys if len(sys.argv) == 2: try: with open(sys.argv[1] , "r") as file: lines = file.readlines() …
Alaa Hamoush's user avatar
1 vote
1 answer
198 views

pizza.py unclear problem when submitting

from tabulate import tabulate import sys import os if len(sys.argv) < 2: sys.exit("Too few Command-line argument") elif len(sys.argv) > 2 : sys.exit("Too many Command-line argument" …
Alaa Hamoush's user avatar
0 votes
1 answer
140 views

scourgify.py problem

I wrote this code for scourgify.py :- import sys import csv import os if len(sys.argv) < 3: sys.exit("Too few Command-line argument") elif len(sys.argv) > 3 : sys.exit("Too many Comm …
Alaa Hamoush's user avatar
1 vote
1 answer
278 views

test_plates.py problem

What is the problem with my code for testing plates.py? this is the code : def main(): plate = input("Plate: ") if iss_valid(plate): print("Valid") else: print("Invalid") …
Alaa Hamoush's user avatar