Skip to content Skip to sidebar Skip to footer
Showing posts with the label Numbers

Guessing A Number, True Or False? Python

I want to assign something a value and then try and get someone to guess that value. I have tried s… Read more Guessing A Number, True Or False? Python

Choosing Only Non-zeros From A Long List Of Numbers In Text File

I have a text file with a long list of numbers. I would like to choose only the non-zeros and make… Read more Choosing Only Non-zeros From A Long List Of Numbers In Text File

Compare Two Python Strings That Contain Numbers

UPDATE: I should have specified this sooner, but not all of the names are simply floats. For exampl… Read more Compare Two Python Strings That Contain Numbers

How Do I Print A Number N Times In Python?

How do I print a number n times in Python? I can print 'A' 5 times like this: print('A&… Read more How Do I Print A Number N Times In Python?

Print Numbers In Terms Of Engineering Units In Python

Possible Duplicate: Print number in engineering format How do I print numbers in scientific notat… Read more Print Numbers In Terms Of Engineering Units In Python

Python Class Fraction Numbers

I made a code that makes the user input two fraction numbers in the form 'd/n'. How can I m… Read more Python Class Fraction Numbers

What Is The Fastest Way To Represent Number As The Sum Of Powers Of Two In Python

For example >>> two_powers(42) >>> (2, 8, 32) My current naive implementation (… Read more What Is The Fastest Way To Represent Number As The Sum Of Powers Of Two In Python

Regular Expression Extracting Number Dimension

I'm using python regular expressions to extract dimensional information from a database. The en… Read more Regular Expression Extracting Number Dimension

How To Avoid The L In Python

>>> sum(range(49999951,50000000)) 2449998775L Is there any possible way to avoid the L … Read more How To Avoid The L In Python

Find N Largest Lines From A File: How Would You Make This Better?

I was recently rejected from a potential employer after submitting this code. They suggested I wasn… Read more Find N Largest Lines From A File: How Would You Make This Better?