Hello There,
This problem isn't so simple as it looks in the title/subject of this email.
I am doing a tutorial on Python, and there is a script named password.py:
password = "foobar"
while password != "unicorn":
password = raw_input("Password: ")
print "Welcome in"
The question says "Mod
On Tue, Jul 17, 2012 at 11:10 AM, Santosh Kumar wrote:
> Hello There,
>
> This problem isn't so simple as it looks in the title/subject of this email.
>
> I am doing a tutorial on Python, and there is a script named password.py:
>
> password = "foobar"
>
> while password != "unicorn":
> passwo
> Date: Tue, 17 Jul 2012 11:23:07 -0400
> From: joel.goldst...@gmail.com
> To: sntshkm...@gmail.com
> CC: tutor@python.org
> Subject: Re: [Tutor] How to print something just after 3 attempts?
>
> On Tue, Jul 17, 2012 at 11:10 AM, Santosh Kumar wrote:
> > Hello There,
> >
> > This problem isn't
Simpler solution:
for i in range(3):
if input("Password: ") == "unicorn":
print("Welcome in..")
break
else:
print("That must have been complicated..")
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To uns
On 17/07/2012 16:28, Paul McNally wrote:
Date: Tue, 17 Jul 2012 11:23:07 -0400
From: joel.goldst...@gmail.com
To: sntshkm...@gmail.com
CC: tutor@python.org
Subject: Re: [Tutor] How to print something just after 3 attempts?
On Tue, Jul 17, 2012 at 11:10 AM, Santosh Kumar wrote:
Hello There,
On 17 Jul 2012 12:39, "Mark Lawrence" wrote:
>
> On 17/07/2012 16:28, Paul McNally wrote:
>> I was able to get it working like this...
>>
>> password = "foobar"
>> attempt = 0
>> while (password != "unicorn") and (attempt <= 3):
>
>
> Please we're talking Python here not C so strip out those un
On 17/07/2012 17:51, Brian van den Broek wrote:
On 17 Jul 2012 12:39, "Mark Lawrence" wrote:
On 17/07/2012 16:28, Paul McNally wrote:
I was able to get it working like this...
password = "foobar"
attempt = 0
while (password != "unicorn") and (attempt <= 3):
Please we're talking Python
Hi Santosh,
On 17 July 2012 16:10, Santosh Kumar wrote:
> The question says "Modify the password guessing program to keep track
> of how many times the user has entered the password wrong. If it is
> more than 3 times, print “That must have been complicated.”
FWIW, I interpret the above to mean
Here is my script:
name = raw_input("What's your name? ")
if name == "Santosh":
print "Hey!! I have the same name."
elif name == "John Cleese" or "Michael Palin":
print "I have no preference about your name. Really!!"
else:
print "You have a nice name."
The if part works well. The e
>
> On Tue, Jul 17, 2012 at 11:10 AM, Santosh Kumar
> wrote:
> > Hello There,
> >
> > This problem isn't so simple as it looks in the title/subject of this
> email.
> >
> > I am doing a tutorial on Python, and there is a script named password.py:
> >
> > password = "foobar"
> >
> > while password
Hi Santosh,
On Jul 17, 2012, at 10:09 PM, Santosh Kumar wrote:
> Here is my script:
>
> name = raw_input("What's your name? ")
>
> if name == "Santosh":
>print "Hey!! I have the same name."
> elif name == "John Cleese" or "Michael Palin":
>print "I have no preference about your name. Re
On Tue, Jul 17, 2012 at 10:09 PM, Santosh Kumar wrote:
> Here is my script:
>
> name = raw_input("What's your name? ")
>
> if name == "Santosh":
> print "Hey!! I have the same name."
> elif name == "John Cleese" or "Michael Palin":
> print "I have no preference about your name. Really!!"
>
On Tue, Jul 17, 2012 at 10:21 PM, Andre' Walker-Loud
wrote:
> Hi Santosh,
>
> On Jul 17, 2012, at 10:09 PM, Santosh Kumar wrote:
>
>> Here is my script:
>>
>> name = raw_input("What's your name? ")
>>
>> if name == "Santosh":
>>print "Hey!! I have the same name."
>> elif name == "John Cleese"
>
> On Jul 17, 2012, at 10:29 PM, Alexandre Zani wrote:
>
>
> On Tue, Jul 17, 2012 at 10:21 PM, Andre' Walker-Loud
> wrote:
>> Hi Santosh,
>>
>> On Jul 17, 2012, at 10:09 PM, Santosh Kumar wrote:
>>
>>> Here is my script:
>>>
>>> name = raw_input("What's your name? ")
>>>
>>> if name == "Sa
On 18/07/12 15:09, Santosh Kumar wrote:
Here is my script:
name = raw_input("What's your name? ")
if name == "Santosh":
print "Hey!! I have the same name."
elif name == "John Cleese" or "Michael Palin":
print "I have no preference about your name. Really!!"
else:
print "You hav
15 matches
Mail list logo