-
Replied To a Post in iteritems() error
If you need your results sorted by frequency and then words, see ... https://www.daniweb.com/software-development/python/threads/20774/starting-python/21#post2169592 -
Created Timing five isprime functions (Python)
Just trying to find out which of these five isprime functions is the fastest. -
Edited Minimum number of bills or coins in change (golang)
This Go snippet calculates the minimum number of bills or coins needed for a given amount of money (change) requested. The program also gives the denomination and number. US curency … -
Edited Using a map for minimum bills or coins (golang)
Again, calculate the minimum number of bills or coins required for a given amount of money (change). This time we will use a Go map instead of a csv string … -
Created Some number tricks (golang)
Just a couple of number tricks to check Go's mathematical abilities. If you have more, let's show them here. -
Replied To a Post in Grains of rice on a chessboard (Python)
Ah, replace '^' with '**'. I am a little dense sometimes, now I see the humor ... square_number = 4 grains = (2**square_number) - 1 if grains == 15: print("It's … -
Replied To a Post in Starting Python
There is always room for one more word frequency program ... ''' Word_frequency2.py experiments with string processing preprocess the string and do a word frequency count remove punctuation/whitespace with re … -
Replied To a Post in Python GUI Programming
Sort a listbox in Tkinter ... '''tk_Listbox_sort1.py load a Tkinter listbox with data then sort the data dns ''' try: # Python2 import Tkinter as tk except ImportError: # Python3 … -
Replied To a Post in Grains of rice on a chessboard (Python)
Hmmm, >>> square_number = 64 >>> (2^square_number) - 1 65 -
Replied To a Post in NEED HELP with project
John Zelle teaches Python at Wartburg College. He is the author of graphics.py used by a number of schools instead of Tkinter Get the graphics module (a thin wrapper for … -
Replied To a Post in C / C++ FAQ's and Practice problems
Find the two multipliers needed to get 1234512345 from 12345 (hint they are primes) -
Replied To a Post in C / C++ FAQ's and Practice problems
Find the number that multiplied by itself gives 12345678987654321 -
Replied To a Post in Grains of rice on a chessboard (Python)
If you look at the loop results carefully, you will discover that the number of grains on each square 1 to 64 is equal to `2**(square-1)` and the number of … -
Edited Grains of rice on a chessboard (golang)
The story has it that a few hundred years ago the ruler of a big country wanted to reward the creator of the chess game. The creator of the game … -
Replied To a Post in Grains of rice on a chessboard (golang)
Hmm, if you stacked the rice grains end to end, at what square would you have enough grains to reach the moon? Assume that a grain of rice is 5 … -
Edited Grains of rice on a chessboard (golang)
The story has it that a few hundred years ago the ruler of a big country wanted to reward the creator of the chess game. The creator of the game … -
Edited Grains of rice on a chessboard (Python)
A few hundred years ago the glorious leader of a big country wanted to reward the creator of the chess game. The creator of the game simply wanted one grain … -
Replied To a Post in using faction and dictonoaries
What have you coded so far? -
Marked Solved Status for anyone know a better method for global enums??
I'm stuck dealing with strings which is a pain when porting code... I'm doing stuff such as porting this: enum { VAL_NULL = 0, VAL_INT, VAL_FLOAT, VAL_STR, VAL_ANY, VAL_CODE, VAL_MACRO, … -
Replied To a Post in anyone know a better method for global enums??
Module enum is new in Python34 see: http://legacy.python.org/dev/peps/pep-0435/ and the Python34 manual -
Revoked Solved Status for anyone know a better method for global enums??
I'm stuck dealing with strings which is a pain when porting code... I'm doing stuff such as porting this: enum { VAL_NULL = 0, VAL_INT, VAL_FLOAT, VAL_STR, VAL_ANY, VAL_CODE, VAL_MACRO, … -
Replied To a Post in unicode related problem when reading a collection of files
My current encoding comes up 'cp1252' because I am using the Anaconda3 Python system. It might be best to set it in open() if you need a specific encoding. -
Edited A slice of prime numbers (golang)
Another translation of one of my Python snippets. This function will return a slice of consecutive prime numbers from 2 to a given value limit. In Go the 'int' type … -
Replied To a Post in Grains of rice on a chessboard (golang)
If you allow for small round-off errors you can use float64 calculations and simplify the code this way ... // chessboard_rice2.go // // put one grain of rice on first … -
Replied To a Post in Grains of rice on a chessboard (golang)
In Go ^ is the exclusive or. Python gives the accurate result 2**64 - 1 = 18446744073709551615 The code was meant to be a good exercise in big math and … -
Replied To a Post in Random Facts
I googled it ... there are 29,000 grains of rice in a pound of rice. More ... Worldwide Rice Production in 2012 was 1,628,000,000,000 pounds which means 47,212,000,000,000,000 grains of … -
Edited Grains of rice on a chessboard (golang)
The story has it that a few hundred years ago the ruler of a big country wanted to reward the creator of the chess game. The creator of the game … -
Created Grains of rice on a chessboard (golang)
The story has it that a few hundred years ago the ruler of a big country wanted to reward the creator of the chess game. The creator of the game … -
Replied To a Post in Grains of rice on a chessboard (Python)
Thank you so much Gribouillis! I made the corrrection. Looks like I lack the basic mathematical concepts too! -
Edited Grains of rice on a chessboard (Python)
A few hundred years ago the glorious leader of a big country wanted to reward the creator of the chess game. The creator of the game simply wanted one grain … -
Replied To a Post in There is an elephant on the loo!
Most common names for baby boys in the USA: Noah, Liam, Mason, Jacob and William -
Replied To a Post in There is an elephant on the loo!
Most common names for baby girls in the USA: Emma, Olivia, Sophia, Isabella and Ava -
Edited Grains of rice on a chessboard (Python)
A few hundred years ago the glorious leader of a big country wanted to reward the creator of the chess game. The creator of the game simply wanted one grain … -
Edited Grains of rice on a chessboard (Python)
A few hundred years ago the glorious leader of a big country wanted to reward the creator of the chess game. The creator of the game simply wanted one grain … -
Edited Grains of rice on a chessboard (Python)
A few hundred years ago the glorious leader of a big country wanted to reward the creator of the chess game. The creator of the game simply wanted one grain … -
Created Grains of rice on a chessboard (Python)
A few hundred years ago the glorious leader of a big country wanted to reward the creator of the chess game. The creator of the game simply wanted one grain … -
Edited Minimum number of bills or coins in change (golang)
This Go snippet calculates the minimum number of bills or coins needed for a given amount of money (change) requested. The program also gives the denomination and number. US curency … -
Created Using a map for minimum bills or coins (golang)
Again, calculate the minimum number of bills or coins required for a given amount of money (change). This time we will use a Go map instead of a csv string … -
Created Minimum number of bills or coins in change (golang)
This Go snippet calculates the minimum number of bills or coins needed for a given amount of money (change) requested. The program also gives the denomination and number. US curency … -
Replied To a Post in tkinter entry widget
If you want the user to be able to scroll through what has been entered and potentially correct errors, you can attach a horizontal scrollbar to Entry() ... ''' tk_Entry_scroll_h.py … -
Replied To a Post in tkinter entry widget
The Entry() field keeps scrolling as you fill it up. If you use value=float(e.get()), the string would have separators like semicolons in it. Function float() can only convert a numeric … -
Replied To a Post in Projects for the Beginner
Write a program that gives you a specified amount of money with a minimum amount of bills and coins of the currency of your choice. -
Replied To a Post in Jokes
A US Marine, a British soldier and a French Legionnaire are captured by cannibals. They put up a grand fight, but there were just too many and they were overwhelmed. … -
Replied To a Post in Jokes
No joke ... I still have my "0 Gravity" Spacetec pen made by Fisher (Bolder City Nevada). -
Replied To a Post in Memorable Quotations
"The most important thing a father can do for his children is to love their mother." ... Theodore Hesburgh -
Replied To a Post in What are you eating/drinking right now?
Egg, sunny side up, a toast with cinnamon sugar, and a cup of mint tea. -
Marked Solved Status for 5 Crucial Projects for Beginners
Well if you were like me and Python is your first language. You are trying to learn programming and many people suggested that learn Python as a first language. You … -
Replied To a Post in 5 Crucial Projects for Beginners
Start coding and if youu have problems, post your code and error message in a new thread here on DaniWeb. We will be glad to help you. -
Replied To a Post in Number to Word Converter (Python)
nickruiz, sharp eye, thank you! I corrected it. -
Edited Number to Word Converter (Python)
Sometimes when you get a large check from your employer, the value is written out in words. I get those all the time of course. So I wrote this little …
The End.