Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

conversion of int to a specified base number

n = int(input())
base = 3

if n == 0:
    print(0)
nums = []
while n:
    n, r = divmod(n, base)
    nums.append(str(r))
print(''.join(reversed(nums)))
Comment

PREVIOUS NEXT
Code Example
Python :: set_flip_h( false ) 
Python :: user logout in django rest framework 
Python :: xlabel font size python latex 
Python :: awk extract one file from another file 
Python :: Get text content dynamo civil 3d 
Python :: discord.py get user input (simplified) 
Python :: how to accept invalidfileexception in python 
Python :: pandas replace % with calculated 
Python :: hypercorn initiate 
Python :: pandas show all columns 
Python :: numpy transpose shorthand 
Python :: check if set is a subset of another python 
Python :: django-filter field name greater than 
Python :: <ipython-input-7-474520f490a8 
Python :: python sys replace text 
Python :: AI code for diagnosing diseases 
Python :: pyqt grid layout 
Python :: r is.na pandas 
Python :: pairplot legend position 
Python :: program to add two numbers in python 
Python :: how-to-add-new-column-to-an-dataframe-to-the-front-not-end 
Python :: Example pandas.read_hdf5() 
Python :: Math Module asin() Function in python 
Python :: df .isna percentage 
Python :: pandas version for python 3.9 
Python :: get parent keys of keys python 
Python :: grab element based on text from html page in python 
Python :: seasonal plot python 
Python :: Python NumPy asanyarray Function Example Tuple to an array 
Python :: percentile of a score python 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =