SHARE
TWEET

Übung 7 NumInf

a guest Jan 24th, 2020 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %reset -f
  2. from numpy import random, sort
  3.  
  4. def zufallszahlen(x,y,z):
  5.     ve=random.randint(x,y,z)
  6.     print(ve,"1")
  7.     ve=sort(ve)
  8.     print(ve,"2")
  9.     for i in range(0,z-1):
  10.         if ve[i]==ve[i+1]:
  11.             ve[i]=ve[i]+1
  12.             ve=sort(ve)
  13.             print(ve,"3")
  14.             for k in range(i,z-1):
  15.                 if ve[k]==ve[k+1]:
  16.                     ve[k]=ve[k]+1
  17.                     ve=sort(ve)
  18.                     print(ve,"4")
  19.         else:
  20.             pass
  21.  
  22.     return ve
  23.  
  24. lz=zufallszahlen(1,20,10)
  25. print(lz)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top