Results for “python string methods”

2 results

  1. Article Mini projects

    Base 6 Number System in Python

    …numpy as np # numpy.base_repr(number, base) returns a string print(np.base_repr(12, 6)) # Output: 20 print(np.base_repr(36, 6)) # Output: 100 print(np.base_repr(101, 6)) # Output: 245…

  2. Article Python Fundamentals

    Python Functions for Beginners

    …You can also describe a function with a docstring , a string in triple quotes placed right under the def line: def weight_on_planet(earth_weight, gravity=0.38): """Return what something would weigh on…