Skip to content

Tag: function

Explanation about def rewind(f): f.seek(0)

i was reading a book and there was a code which had a this line in it and this is a line that i can’t understand can you please explain me what is going on ? -im using python 2.7 thanks for your time Answer I would try reading this post on tutorials point. The top of the article should

Syllable Count In Python

I need to write a function that will read syllables in a word (for example, HAIRY is 2 syllables). I have my code shown on the bottom and I’m confident it works in most cases, because it works with every other test I’ve done, but not with “HAIRY” where it only reads as 1 syllable. TEST…

How to define enum values that are functions?

I have a situation where I need to enforce and give the user the option of one of a number of select functions, to be passed in as an argument to another function: I really want to achieve something like the following: So the following can be executed: Answer Your assumption is wrong. Values can be arbitrary,…