Search Results
| 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 python
Search options not deleted user 40802
Code using the python language.
0 votes
2 answers
462 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 … sys.exit("File does not exist") print(Linesofcode) elif len(sys.argv) == 1: sys.exit("Too few command-line arguments") elif ".py" not in sys.argv: sys.exit("Not a python …
1 vote
pizza.py unclear problem when submitting
I have figured out the solution, it was just a logical fault in my code that lead to the same output. So instead of : typ , small , large = line.split(",") list = [typ,small,large] I used the csv.rea …
1 vote
1 answer
205 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" …
0 votes
1 answer
148 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 …
1 vote
1 answer
310 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") …