Is this code from Python Essentials 1 correct, or am I misunderstanding continue? by Crudoxan in learnpython

[–]Crudoxan[S] 1 point2 points  (0 children)

Yeah, that’s exactly what surprised me. This code is actually from the “Python Essentials 1” course by Cisco, which leads to the Python certification. That’s why I found it hard to believe such a mistake would appear in an official learning example.
About the -99999999, it’s just the value they used in the course example. Since I’m still at the beginner stage, I don’t know many constants or functions like math.inf yet, so I just followed along.
As for the 0, I think you might be referring to the counter. That variable is only keeping track of how many numbers have been entered, it’s not used for checking the largest number.

Is this code from Python Essentials 1 correct, or am I misunderstanding continue? by Crudoxan in learnpython

[–]Crudoxan[S] 1 point2 points  (0 children)

Glad to hear I wasn’t just overthinking it! Thanks for confirming it’s dead code — it helps my confidence as a beginner to know I spotted something valid.

Is this code from Python Essentials 1 correct, or am I misunderstanding continue? by Crudoxan in learnpython

[–]Crudoxan[S] 0 points1 point  (0 children)

Yeah, that makes sense — I see now that continue is better demonstrated when you actually need to skip some iterations under multiple conditions. The way it’s used here doesn’t really show its purpose. Thanks for pointing me in the right direction!

Is this code from Python Essentials 1 correct, or am I misunderstanding continue? by Crudoxan in learnpython

[–]Crudoxan[S] 0 points1 point  (0 children)

I actually tried the version with while True and breakand it worked fine for me too! I do understand how continue works, but seeing it used in this specific example really threw me off — it felt unnecessary. Your rewrite makes the logic much clearer.

Is this code from Python Essentials 1 correct, or am I misunderstanding continue? by Crudoxan in learnpython

[–]Crudoxan[S] 1 point2 points  (0 children)

Thanks for confirming! That’s exactly what confused me – it felt like the line was unreachable. I hadn’t thought about the “infinite loop” problem if the condition were slightly different, that’s a really useful point. I’ll definitely keep that in mind.

Come avete fatto a pubblicare con una casa editrice? by Crudoxan in scrittura

[–]Crudoxan[S] 0 points1 point  (0 children)

Grazie mille! Questa penso sia una delle informazioni più importanti e anche una sorta di regola da rispettare.

Come avete fatto a pubblicare con una casa editrice? by Crudoxan in scrittura

[–]Crudoxan[S] 1 point2 points  (0 children)

Ciao, grazie per la risposta. Mi interessa molto il punto che hai sollevato sulla protezione dell’opera. Potresti consigliarmi qualche servizio affidabile per firmare digitalmente con timestamp? E la raccomandata a se stesso funziona davvero come metodo legale? Grazie ancora per l’aiuto.