Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

while loop choosing numbers

import random
import time

random_number = (1,999) #choose a number. you can choose whatever you want
cando = True
times = 0

while cando:
    go_print = random.randint(random_number)
    print(go_print)
    times = times + 1
    time.sleep(0.05)
    if times == 100:
        cando = false
        print("the number is" + go_print)    
Comment

PREVIOUS NEXT
Code Example
Python :: index operator in python without input 
Python :: numpy array filter and count 
Python :: Create a matrix from a range of numbers (using arange) 
Python :: indexers in python 
Python :: is reversed a generator python 
Python :: full_pickle 
Python :: Filter xarray (dataarray) 
Python :: whois eyedress 
Python :: limiting user input to under 100 characters python 
Python :: calculate time between datetime pyspark 
Python :: reset csv.DictReader python 
Python :: subprocess open txt file python 
Python :: import 
Python :: pandas difference of consecutive values 
Python :: series clip 
Python :: yticks in plotly expres 
Python :: python forward and bachward seperators 
Python :: python get function from string name 
Python :: get number of occurrences of substring case independent python 
Python :: python dijkstra implementation stack 
Python :: what takes more memory string or list python 
Python :: Rewrite the equation shown in Figure 2.4 as a Python expression and get the result of the equation: Pay special attention to the order of operations. 
Python :: inspect first 5 rows of dataframe 
Python :: python fibonacci numbers 
Python :: KivyMD video recording 
Python :: Read large SAS file ilarger than memory n Python 
Python :: how to use lambda function in python 
Python :: invalid literal for int() with base 10 python 
Python :: sklearn model persistence 
Python :: python dynamic csvnfile joining 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =