.
> Thanks Christian for your links and code
>
>
> ___
> Tutor maillist - Tutor@python.org
>
> To unsubscribe or change subscription
> options:http://mail.python.org/mailman/listinfo/tutor
>
>
> Below [1] is how I would write it, which is simply a
>>> splitWord('google', 2)
['go', 'og', 'le']
>>> splitWord('google', 3)
['goo', 'gle']
>>> splitWord('apple', 1)
['a', 'p', 'p', 'l', 'e']
>>> splitWord('apple', 4)
['appl', 'e']
def splitWord(word, number):
length=len(word)
list1=[]
x=0
How can i convert this-
>>>time24hr('12:34am')
'0034hr'
i searched in date module but i am not able to figure out what how to do
this...
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailm
In Dictionary-
How to print corresponding keys if the values of dictionary is given??
-d={'a':1,'b':2,'c':3}
-i can print the corresponding values by using get() method-
- d.get('a')
-1
What if i have to print reverse???
___
Tutor maillist - Tutor@pyt
In function-
"Default value is *evaluated only once*.This makes different when the
default is a mutable object such as a list, dictionary or instance of most
classes."
I am not getting it properly-evaluated once?? different behaviour???--
please explain this.
_
i have two questions-
1.>>> removeLetter("hello", "l")
>>>'heo'
To tackle this problem i am using set so that i can remove duplicates.
def removeLetter(word,letter)
set(word).remove(letter)
return ''.join(set(word))
I am not getting right answer.I think i am not using sets correctly.pl
This is my code-
def getNumbers(num):
myList=[]
for numbers in range(0,num,2):
print myList.append(numbers)
output-
>>> getNumbers(10)
None
None
None
None
None
Then i find out that list.append doesn't return anything.Then what should i
use for this kind of operation.but if i d
this is one of the problem based on list which i found at pyschool.
CountWords("google")
[('e',1),('g',2),('l',1),('o',2)]
by the level of this question you can easily understand i am new in
python.the problem i am facing is how to make set of word and count(e,1) and
add this to list??
__
i am a beginner in python.i am not asking about any books here.As i have
heard one essential steps of learning is to look for some good python
codes.So, can you guys please and please suggest me some sites or some small
projects where i can find these codes?? please remember i am at a BEGINNER's
le