Explanation:
๐น 1. Variable Assignment
clcoding is a variable used to store a value.
๐น 2. int() Function
int() converts a value into an integer.
๐น 3. Binary Input
"101" is a binary number given as a string.
๐น 4. Base Argument (2)
The number 2 tells Python that "101" is in base 2 (binary).
๐น 5. Conversion Process
Binary 101 → Decimal:
1×2
2
+0×2
1
+1×2
0
=5
๐น 6. Storing Result
The converted value 5 is stored in clcoding.
๐น 7. Output Statement
print(clcoding) displays the value.
๐น 8. Final Output
5

0 Comments:
Post a Comment