Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python random phone number

import random

def phn():
    n = '0000000000'
    while '9' in n[3:6] or n[3:6]=='000' or n[6]==n[7]==n[8]==n[9]:
        n = str(random.randint(10**9, 10**10-1))
    return n[:3] + '-' + n[3:6] + '-' + n[6:]
Comment

generate random number python

import random

random.randint(lower, upper)
Comment

create random phone number python

# import module
import random as r
  
ph_no = []
  
# the first number should be in the range of 6 to 9
ph_no.append(r.randint(6, 9))
  
# the for loop is used to append the other 9 numbers.
# the other 9 numbers can be in the range of 0 to 9.
for i in range(1, 10):
    ph_no.append(r.randint(0, 9))
  
# printing the number
for i in ph_no:
    print(i, end="")
Comment

generate random number python

import random
lower_limit = 0 # Can be anything
upper_limit = 100 # Again, can be anything
# Print it out
print(f"Here is a random number: {random.randint(lower_limit, upper_limit)}
Comment

PREVIOUS NEXT
Code Example
Python :: python opening file modalities 
Python :: optimal alpha jupyter 
Python :: python print statement 
Python :: Printers Stampanti 
Python :: how to find the medium, first, second and third quartile in a pandas data frame 
Python :: how to remove explicit string concatenation 
Python :: what does features = data.drop(["Survived", "Sex", "Embarked"], axis=1) do in python 
Python :: how to calculate chi square in python 
Python :: spevify datatype of column 
Python :: Random Hex Colors bar generator, python turtle 
Python :: Using rstrip() method to remove the newline character from a string 
Python :: python dataframe copy structure 
Python :: print function in python 
Python :: if number Of Players == =4 python 
Python :: what is fourier transform in python 
Python :: Read data from excel file using openbyxl 
Python :: plot bar chart python with resulting numbers 
Python :: text files to words generator 
Python :: longueur liste python 
Python :: numpy array majority and how many 
Python :: def identity_block(X, f, filters, training=True, initializer=random_uniform): 
Python :: Replace u00a0 
Python :: how to make an infinite loop in python 
Python :: django query or condition for query parameters 
Python :: binarizer pyspark 
Python :: how to convert a sentence into a list of words in python 
Python :: fouier transformation in python open cv 
Python :: print e 
Python :: tcs question 
Python :: python filter dictionary 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =