Quick actions

cmd+k|ctrl+k

Navigation

Languages

built in functions and methods

Snippet info

Language

Python

Visibility

public

Author

dylansiegelman

Created

2024-04-01T19:06:50.191355Z

Updated

2024-04-01T19:06:50.191355Z

print(len('yoooooooo')) # counts the letters. doesnt count from 0, counts from 1
print(len('1000000'))

cool = 'awesome'
print(cool[0:len(cool)])
print(cool[0:2])

#methods are specific to a type or class. methods start with periods(?)

quote = 'i love things'
print(quote)
print(quote.upper())
print(quote.capitalize())
print(quote.find('love'))
print(quote.find('i'))
print(quote.find('things'))

print(quote.replace('things', 'stuff'))
print(quote) #this is unchanged because strings are immutable, the line above creates a new string

quote2 = quote.replace('things', 'stuff')
print(quote2)
INFO