Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Linear congruential generator in python

def rng(m=2**32, a=1103515245, c=12345):
    rng.current = (a*rng.current + c) % m
    return rng.current/m

# setting the seed
rng.current = 1
for i in range(10):
  rng()
Comment

PREVIOUS NEXT
Code Example
Python :: circular array python 
Python :: python check if string has space 
Python :: django drop database postgres 
Python :: how to set default user group in django 
Python :: Concatenate strings from several rows using Pandas groupby 
Python :: case statement in querset django 
Python :: how to input a string in streamlit 
Python :: give answer in 6 decimal python 
Python :: basemap python 
Python :: runtime.txt heroku python 
Python :: python restart script 
Python :: python check if string is int 
Python :: root template 
Python :: jupyter upload folder 
Python :: how to detect language python 
Python :: python string match ignore case 
Python :: smtplib not sending email 
Python :: Django group by date from datetime field 
Python :: how to open xml file element tree 
Python :: concatenate dataframes 
Python :: dictionary to a dataframe pandas arrays must all be same length 
Python :: install virtual environment python mac 
Python :: second y axis matplotlib 
Python :: Python Crash Course, 2nd Edition: A Hands-On, Project-Based Introduction to Programming 
Python :: python get string from decimal 
Python :: finding the Unique values in data 
Python :: swapping of two numbers in python 
Python :: python timestamp to datetime 
Python :: python strptime format codes 
Python :: difference of two set in python 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =