Codeforces Round 1133 (Div. 1, Div. 2) is coming soon! Register here. ×

the_seal's blog

By the_seal, history, 12 months ago, In English

A year ago I have started competitive programming with Python mostly because it was the language I knew best. My university major is AI, so Python was already my go-to. At first I struggled a lot with with TLEs and missing handy C++ STL features, and moments of doubt where I wondered if I should switch to C++ but I have decided to stick with python to see how hard is it to use python for CP. After a year I don’t regret sticking with Python. It’s been hard but rewarding and a great learning experience.

If your goal is only competitive programming and you are not ready to get TLE while the same C++ code get accepted then do C++ but if you want to learn more about python and get used to it , Python is absolutely doable and fun.

I will keep using Python for now. It has taught me a lot about writing efficient and optimized code. If I ever switch to C++ I’ll write a follow-up blog about it :)

  • Vote: I like it
  • +47
  • Vote: I do not like it

| Write comment?
»
12 months ago, hide # |
 
Vote: I like it +21 Vote: I do not like it

Python as the snake ?

»
12 months ago, hide # |
 
Vote: I like it +4 Vote: I do not like it
»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

ily python :3

»
12 months ago, hide # |
 
Vote: I like it +6 Vote: I do not like it

Hope to see you as an Python user ICPC finalist

»
12 months ago, hide # |
 
Vote: I like it +6 Vote: I do not like it

Although I’m not a fan of using python in cp, your progress across the last year has been amazing, huge respect tbh

still come to c++ it’s better :)

»
12 months ago, hide # |
 
Vote: I like it +14 Vote: I do not like it

im not a big fan of snakes personally

»
12 months ago, hide # |
← Rev. 3  
Vote: I like it +1 Vote: I do not like it

Can't be more relatable!

»
12 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

As a pupil who does CP only in Python, this post feels very convincing.

»
12 months ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

The seal swims in the sea, the python moves in the grass, and Emad grinds in the contests

»
12 months ago, hide # |
 
Vote: I like it +29 Vote: I do not like it

LOL, what about someone who uses C++ and gets TLE?

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Python? Doesn't it sting..

»
12 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

Python was my first programming language. While college made me switch to C & eventually C++, Python is still my go-to for strings :3

Hey Python, I still think of you lovingly <3

»
12 months ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

MEOWW

Tomatoes are mid

You r the best python dude ever =)

»
12 months ago, hide # |
 
Vote: I like it +11 Vote: I do not like it

Your journey in competitive programming is truly inspiring. I'm glad I'm watching this from the front seats.

Can't wait to see the seal backflip on stage

  • »
    »
    12 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Working on the backflip

    and thank you for being the only one who weren’t against python

    my favorite coach ever

»
12 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

I'd actually imagine that programming optimized python code is harder (even with pypy) and thus requires being much more careful with the implementation.

On that note, is there any set of techniques that yall've learned for doing just that?

  • »
    »
    12 months ago, hide # ^ |
     
    Vote: I like it +3 Vote: I do not like it

    not really you just need to put some notes in mind one of the funny ones is that python hashes strings way better than integers and in python maps and sets uses hash unlike c++ so sometimes you can get tle just for using integers in a set without casting them into strings and sometimes you can get tle for not using fast input and output

»
12 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

Yeah, As I go on I explore new ways to do things in Python3 like yesterday I found about StringIO() for string concatenation, which is faster compared to normal concatenation.

»
12 months ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

BEST PYTHON CPER

»
12 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

I am a python but I can't see.

»
12 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

betting 7 JOD

python master by 2026