+ 1

explain what is max=max and max=0 means code in description

https://code.sololearn.com/c4J7InnuQGL3/?ref=app

18th Feb 2023, 8:51 AM
AruN
AruN - avatar
4 ответов
+ 11
⚡_AruN_⚡ your question / code sample is truncated since the *question section* can only take a limited number of characters as input. it would be helpful if you could add the complete code you are talking about to your post but not only 1 line.
18th Feb 2023, 11:45 AM
Lothar
Lothar - avatar
+ 7
⚡_AruN_⚡ , first of all: > we should *not* use *max* as a variable name, since this also is the name of built-in function of python. > using reserved names for objects like variables (and others), can lead to unexpexted results or behavior of the program. > max = 0 is the declaration and initialization of a variable with the value of 0. in the current code this step is *not required*, since max is created inside the first *if... else...* conditional. in other cases (if max will be used for comparison in the first conditional) it may be necessary. > max = max means that the variable max gets assigned to itself. this step is *not required* and the complete *else* clause can be removed.
20th Feb 2023, 7:24 AM
Lothar
Lothar - avatar
+ 3
For maximum number you need to learn about if else statements
18th Feb 2023, 9:34 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 1
Sorry sorry I will update
18th Feb 2023, 11:53 AM
AruN
AruN - avatar