Minecraft PC IP: play.cubecraft.net

Trickmaster

Dedicated Member
May 23, 2014
1,175
958
188
Potato Heaven
Oh and I know you could just do
>>> white_rabbit.find('late', 0, 19)

But I'm looking to know how to shorten that so the 0 isn't needed.
 

Trickmaster

Dedicated Member
May 23, 2014
1,175
958
188
Potato Heaven
Code:
def shortfind(str, substr, end):
  return str.find(substr, 0, end)


shortfind(white_rabbit, 'late', 19)
So in other words there's no way to shorten the method call for an end index in a single line of code? unlike specifying the starting index in a code example below?
Code:
white_rabbit.find('late', 7)
 

alyphen

Well-Known Member
Jan 4, 2014
101
109
118
29
127.0.0.1
seventh-root.com
So in other words there's no way to shorten the method call for an end index in a single line of code? unlike specifying the starting index in a code example below?
Code:
white_rabbit.find('late', 7)
Nope, but I don't see what you're trying to gain by finding syntactic sugar for the same result. Just specify 0 as the first parameter.
 
  • Like
Reactions: Trickmaster
Members Online

Team online

Latest profile posts

Today, something awesome happened! I had just mined over 90 iron and coal in skyblock. Then, I put them in 2 furnaces. I had to leave for a few seconds, so I went to the lobby and left. When I came back, ALL OF THEM WERE GONE. The three signs I placed, all the iron and coal, gone. NO ONE WAS ONLINE. I have to get them again, I suppose. At that point, I was thinking about my existence and how my luck is so good! :D
deadganz wrote on MayMood1's profile.
maymood = bgdef
The first Skyblock update leak was posted in Discord today! What do you think?

what_is_sb_update.png

sb_leak_1.png
Kazwa wrote on maoawa's profile.
happy birthday! 🎉
My best friend said me "you are a pro at stealing my kills"
but I was just trying to help him
Top Bottom