Chris Clifton via Tutor wrote:
> I have been practicing with strings. Splitting them, joining them,
> changing case. All has been going well but came across a exercise in one
> of the code practice sites that has you changing the case of different
> characters in a string. Anything in upper cas
On 03/08/16 00:30, Alan Gauld via Tutor wrote:
>> if item == item.lower():
I meant to add that the string islower() method is probably
more readable:
if item.islower()
Also that you could use a list comprehension to do this without
converting to a list initially:
def conveert(text):
On Tue, Aug 2, 2016 at 7:59 AM, Chris Clifton via Tutor
wrote:
> My Logic: Since a string is immutable, I converted it to a list to separate
> out the characters and keep them in order. Idea is to change the case of the
> characters in the list then run a join to convert it back to a string.
On 02/08/16 15:59, Chris Clifton via Tutor wrote:
> My Logic: Since a string is immutable, I converted it to a list
That is certainly one approach but your solution has some snags.
In fact its probably not necessary unless you want to play with
big strings. You could just build a new string from
Hello Everyone,
I have been practicing with strings. Splitting them, joining them, changing
case. All has been going well but came across a exercise in one of the code
practice sites that has you changing the case of different characters in a
string. Anything in upper case is converted to
On 05/07/16 04:36, Frank Lawrence wrote:
> Hello, I have a code here that I’m having a problem with.
Unfortunately we can't see it.
Now, I could see it among a bunch of HTML when I checked it in the
moderator queue, so I'm guessing you sent it as some kind of
attachment and the server has stripp
Hello, I have a code here that I’m having a problem with. It’s supposed to be a
pizza ordering simulator, as you can tell by the title, but I keep trying to
add music to it and whenever I try to play the music with the program running,
it always freezes up and crashes. Can someone help me with t
On 01/09/15 14:07, Nathan Clark wrote:
I have written another basic program out of python, please could you
instruct me on how to fix it
question= input("What is your question)
print("Let me think about that")
time.sleep(10) #10 seconds wait
print (question)
print ("lol")
On Tue, Sep 01, 2015 at 02:07:51PM +0100, Nathan Clark wrote:
> I have written another basic program out of python, please could you
> instruct me on how to fix it
I assume you are using Python 3, is that correct?
> question= input("What is your question)
> print("Let me think about that")
I have written another basic program out of python, please could you
instruct me on how to fix it
question= input("What is your question)
print("Let me think about that")
time.sleep(10) #10 seconds wait
print (question)
print ("lol")
On Thu, Aug 20, 2015 at 4:08 PM, Job wrote:
On 20/08/2015 15:49, Aravind Jaya wrote:
time = input("How long on average do you spend on the computer per day?")
if time <= 2:
print "Message1"
else:
print "Message2"
If you insist on top posting you could at least get your response
correct. The comparison will fail in Python 3.3
Op 20-08-15 om 16:49 schreef Aravind Jaya:
time = input("How long on average do you spend on the computer per day?")
if time <= 2:
print "Message1"
else:
print "Message2"
This will raise 2 errors:
- time will be a string. So time <= 2 is invalid.
- print is a function.
Updated co
On Thu, Aug 20, 2015 at 2:12 PM, Freddy wrote:
> Hello,
>
> I am trying to make Hangman. But main part of the game i.e. comparing user
> input with secret word is not working properly.
>
> Can you have a look where am I going wrong?
>
>
> Thank you
>
> Attachment: Python code file.
>
No attachment
On 20/08/15 18:07, Alan Gauld wrote:
(print("that seems reasonable")) if time<=2
else print ("get a life")
There is an alternative way of writing what you want but
it's not very commonly used:
print("that seems reasonable" if time <=2 else "get a life")
I just realized that the OP's versi
Hello,
I am trying to make Hangman. But main part of the game i.e. comparing
user input with secret word is not working properly.
Can you have a look where am I going wrong?
Thank you
Attachment: Python code file.
___
Tutor maillist - Tutor@py
time = input("How long on average do you spend on the computer per day?")
if time <= 2:
print "Message1"
else:
print "Message2"
On Thu, Aug 20, 2015 at 3:20 PM, Nathan Clark <26110...@gmail.com> wrote:
> I have written a basic program out of python and it is not functioning,
> please c
On 20/08/15 10:50, Nathan Clark wrote:
I have written a basic program out of python and it is not functioning,
please could you proof read my code and tell me how to fix it.It is in
python 3.3
time=int(input("How long on average do you spend on the computer per day?")
(print("that seems reasonab
On 8/20/2015 2:50 AM, Nathan Clark wrote:
I have written a basic program out of python and it is not functioning,
please could you proof read my code and tell me how to fix it.It is in
python 3.3
time=int(input("How long on average do you spend on the computer per day?")
(print("that seems reaso
I have written a basic program out of python and it is not functioning,
please could you proof read my code and tell me how to fix it.It is in
python 3.3
time=int(input("How long on average do you spend on the computer per day?")
(print("that seems reasonable")) if time<=2
else print ("get a life"
19 matches
Mail list logo