[Tutor] Creating Lists

2014-11-12 Thread niyanaxx95
Create a list of 20 unique (no number appears twice) random integers with values between 1 and 45. Print the list of random numbers with the header “Random list of 20 numbers”. Find the largest number in the list. Remove the largest number from the list. Find the smallest number in the list.

Re: [Tutor] Creating Lists

2014-11-12 Thread Alan Gauld
On 12/11/14 04:27, niyanax...@gmail.com wrote: Create a list of 20 unique (no number appears twice) random integers with values between 1 and 45. Print the list of random numbers with the header “Random list of 20 numbers”. Find the largest number in the list. Remove the largest number

Re: [Tutor] Creating Lists

2014-11-12 Thread Ben Finney
niyanax...@gmail.com writes: Create a list of 20 unique (no number appears twice) random integers […] Print the list with the header “The list with the largest and smallest number removed: ” That all sounds like a good assignment. Feel free to show us your complete program and we can offer

[Tutor] syntax error with raw input

2014-11-12 Thread Vaibhav Banait
Hi I am new to python. I learnt (!) using raw_input a day back. Attempt to use has resulted in error. I am not able to spot a problem in syntax. I am using python 3.4.2. Kindly help a = raw_input(Write down your name: ) Output: Traceback (most recent call last): File pyshell#1, line 1, in

Re: [Tutor] syntax error with raw input

2014-11-12 Thread Chris Warrick
On Wed, Nov 12, 2014 at 12:08 PM, Vaibhav Banait careendosc...@gmail.com wrote: Hi I am new to python. I learnt (!) using raw_input a day back. Attempt to use has resulted in error. I am not able to spot a problem in syntax. I am using python 3.4.2. Kindly help a = raw_input(Write down

Re: [Tutor] syntax error with raw input

2014-11-12 Thread Alan Gauld
On 12/11/14 11:08, Vaibhav Banait wrote: Hi I am new to python. I learnt (!) using raw_input a day back. Attempt to use has resulted in error. I am not able to spot a problem in syntax. I am using python 3.4.2. Kindly help Looks like you are reading a v2 book/tutorial but using v3. In v3

[Tutor] Creating Table

2014-11-12 Thread niyanaxx95
Create a table based on two user inputs. Have the user enter two integers between 2 and 6. Validate the user inputs are in the proper range as they are entered. The first integer represents the number of rows in the table. The second integer represents the number of columns. Create the

Re: [Tutor] syntax error with raw input

2014-11-12 Thread wesley chun
Slightly hijacking this thread a bit, specifically Alan's reply, if anyone is averse to installing multiple versions of Python on their computers, you can always access a Python interpreter from a browser window. Here are a collection I've put together. Most are Python 2, but the top pair also

Re: [Tutor] Creating Table

2014-11-12 Thread Danny Yoo
On Wed, Nov 12, 2014 at 11:33 AM, niyanax...@gmail.com wrote: Create a table based on two user inputs. Have the user enter two integers between 2 and 6. Validate the user inputs are in the proper range as they are entered. The first integer represents the number of rows in the table. The

Re: [Tutor] Creating Table

2014-11-12 Thread Steven D'Aprano
My reply is interleaved between your comments. On Wed, Nov 12, 2014 at 07:33:50PM +, niyanax...@gmail.com wrote: This is what I have. I am very confused on what to do. What part is confusing? Try to ask *specific* questions, don't expect us to do your homework for you. i = 6 j = 6

Re: [Tutor] syntax error with raw input

2014-11-12 Thread Steven D'Aprano
On Wed, Nov 12, 2014 at 04:38:51PM +0530, Vaibhav Banait wrote: Hi I am new to python. I learnt (!) using raw_input a day back. Attempt to use has resulted in error. I am not able to spot a problem in syntax. What makes you think it is a problem with syntax? This is what happens when you

Re: [Tutor] Creating Lists

2014-11-12 Thread Steven D'Aprano
On Wed, Nov 12, 2014 at 04:27:33AM +, niyanax...@gmail.com wrote: Create a list of 20 unique (no number appears twice) random integers with values between 1 and 45. Here is how I would produce a list of 7 unique random integers with values between 123 and 175. Lines starting with py

Re: [Tutor] “has a value of True” versus “evaluates true” (was: don't understand iteration)

2014-11-12 Thread Steven D'Aprano
On Tue, Nov 11, 2014 at 10:24:00AM +1100, Ben Finney wrote: Clayton Kirkwood c...@godblessthe.us writes: Also of confusion, the library reference says: Match objects always have a boolean value of True. Since match() and search() return None when there is no match, you can test whether

Re: [Tutor] “has a value of True” versus “evaluates true”

2014-11-12 Thread Steven D'Aprano
On Wed, Nov 12, 2014 at 01:25:15AM +, Danny Yoo wrote: Just to note; not all programming languages do it this way. Python is fairly permissive in what it allows to be truthy. See: https://plus.google.com/+ShriramKrishnamurthi/posts/4qvvKYC1R8Y for a brief survey of what many other