How to select a number without replacement in python
<p>So I'm trying to make a mix and match between numbers here is my code</p>

<pre><code>import random

P1 = float(input("Person's name?")) 
P2 = float(input("Person's name?")) 
P3 = float(input("Person's name?"))

A1 = float(input("Activity?")) 
A2 = float(input("Activity?")) 
A3 = float(input("Activity?")) 

s = (A1, A2, A3)

cool1 = random.sample([A1, A2, A3],1)
cool2 = random.sample([A1, A2, A3],1)
cool3 = random.sample([A1, A2, A3],1)


print ("%s job is %s." %(P1, cool1))

print ("%s job is %s." %(P2, cool2))

print ("%s job is %s." %(P3, cool3))
</code></pre>

<p>The problem is that it is randomizing but it keeps repeating numbers like here</p>

<p>**</p>

<blockquote>
  <p>1.0 job is [4.0].
  2.0 job is [5.0].
  3.0 job is [4.0].</p>
</blockquote>

<p>**</p>

<p>What can I do to make it not repeat.
I'm using python 2.7.12</p>

<p>Also how can I use alphanumerical instead of float only.</p>

<p>Since you are selecting from a list, then you should delete the entry from the list after each check.</p>

<ol>
<li><p>Create your original list, which will be used as needed.</p></li>
<li><p>Create a second list from the first to use as you select.</p></li>
<li><p>As you choose each element from the list, remove it</p></li>
<li><p>Put the chosen element into a list of chosen element.</p></li>
</ol>

<p><a href="http://www.tutorialspoint.com/python/list_remove.htm" rel="nofollow">Python remove method</a></p>

<blockquote>
  <p><strong>Parameters</strong><br>
  obj -- This is the object to be removed from the list.</p>
  
  <p><strong>Return Value</strong><br>
  This method does not return any value but removes the
  given object from the list.</p>
  
  <p><strong>Example</strong><br>
   The following example shows the usage of remove() method.</p>

<pre><code>#!/usr/bin/python

aList = [123, 'xyz', 'zara', 'abc', 'xyz'];

aList.remove('xyz');
print "List : ", aList
aList.remove('abc');
print "List : ", aList
</code></pre>
  
  <p>When we run above program, it produces following result â</p>

<pre><code>List :  [123, 'zara', 'abc', 'xyz']
List :  [123, 'zara', 'xyz']
</code></pre>
</blockquote>

python python-2.7