Sep 24, 2024
my_string = "bioinformatics"
print()
function to display strings.string.lower()
for lowercase.string.upper()
for uppercase.my_string.lower()
my_string.upper()
string.capitalize()
to capitalize the first letter.my_string.capitalize()
len()
function to find the number of characters.len(my_string)
in
keyword.string.find()
to find the index of a substring.string.count()
to count occurrences.my_string.count("o")
string.replace(old, new)
to replace parts of a string.my_string.replace("old", "new")
+
operator or string formatting.full_name = first_name + " " + last_name
%s
or str.format()
for formatting."Hello, %s!" % name
"Hello, {}!".format(name)
[start:end:step]
.gc = dna.count('G') + dna.count('C')
gc_percent = (gc / len(dna)) * 100