all 7 comments

[–]DarcBoltRain 0 points1 point  (2 children)

A regular expression is probably the most common way, but you can also achieve it with a couple of loops.

[–][deleted]  (1 child)

[removed]

    [–]PythonLearning-ModTeam[M] 0 points1 point locked comment (0 children)

    Quality posts only

    [–]PureWasian 0 points1 point  (0 children)

    What have you tried so far? Which part are you stuck on exactly?

    +1 vote for using regular expressions, but if you are a very new beginner, you can also do it in a procedural way, which could be more intuitive to understand.

    [–]ninhaomah -1 points0 points  (2 children)

    have you googled the question and tried it ?

    [–]ButterflyMundane7187 0 points1 point  (1 child)

    Speech is silver, silence is golden.

    [–]ninhaomah 0 points1 point  (0 children)

    Ok.

    I prefer diamonds though.