How Many Lines Of Code Is Python?

For example Python’s pass or Transact-SQL’s begin and end .

This counts as 1 line of code and 3 lines of comments.

Is 5000 lines of code a lot?

5000 lines is totally fine, if you’ve done your job well. That number might go up, it might go down, depending on your job. Length of code isn’t a measure of code quality, but some quality code is necessarily long.

How do you count lines of code in Python?

Count lines of code in directory using Python

  • Use os.walk to traverse the files and sub directories, use endswith to filter the files you want to count, open each file and use sum(1 for line in f) to count the lines, aggregate all the file line counts. – wwii Jul 23 ’16 at 17:02.
  • The built-in utility wc probably deserves mention here despite not being python.

How many lines of code is written in a day?

So writing code must be the most important thing, correct? If the average programmer writes about 50 lines of production code a day. A 50,000 line program would take 1,000 man days to produce. The 50,000 line listing can be entered by a programmer at about 1,000 lines a day or about 50 man days.

How many lines of code is too much for one file?

So a source file that is more than 2000 lines is probably too large and starting to be too messy.

How much does a line of code cost?

With this approach given an average salary $60K and 1850 hours worked per year, you’ll get hourly cost $78-$97. Let’s assume that the cost of man-hour is $100 and in average an employee works 1850 hours per year. Then the cost of a single line of a code will be between $12.33 and $18.5.

Which code has the most lines?

As you can see, Google has by far the largest codebase of all. And all 2 billion lines of code fits into a single code repository.

How many lines of code is Facebook?

The Android operating system runs on 12-15 million lines. The Large Hadron Collider uses 50 million lines. Not including backend code, Facebook runs on 62 million lines of code.

How do I read a text file in Python?


  1. Python allows you to read, write and delete files.
  2. Use the function open(“filename”,”w+”) to create a file.
  3. To append data to an existing file use the command open(“Filename”, “a”)
  4. Use the read function to read the ENTIRE contents of a file.
  5. Use the readlines function to read the content of the file one by one.

How do I count lines in a file?

there are many ways. using wc is one. The tool wc is the “word counter” in UNIX and UNIX-like operating systems, you can also use it to count lines in a file, by adding the -l option, so wc -l foo will count the number of lines in foo .

How many lines of code is Minecraft?

4,815,162,342 lines

How many lines of code is good?

Counting lines of code is a bad way of measuring the performance of a programmer anyways, but you should be able to write one line in about two minutes so 30 lines per hour would be a good speed.

How many lines of code is Google?

2 Billion Lines