Results for “python string methods”

8 results

  1. Challenge

    Strings don't change

    code[0] = "X" stops with a TypeError, because Python strings can't be changed. Predict the crash, find out what methods and slices really give, build a new string instead, then swap a letter in the…

    Fix the code Easy 3 stages strings immutability slicing TypeError
  2. Challenge

    File name from data

    …. Then print it: File: eng-2_2026-03-14.csv Inside an f-string's braces you can call methods too: {sensor_id.lower()} . From a name The configuration form gives sensors names like Star Tracker A , and…

    Write the code Easy 3 stages strings f-strings lower replace
  3. 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…

  4. 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…