0

hel pls easy question

message = int(input("Message:"), 16) what does the ,16 do ? does it limit the variable zize ?

2nd Mar 2021, 4:13 PM
Benjamin S
Benjamin S - avatar
3 odpowiedzi
+ 4
No , it tells the int function that the given string is in hexadecimal form and it should convert it to an integer form which is decimal number with base 10. For example "11" will be converted to 17 . Since hexadecimal has a base 16 , 17 can be represented as 16+1,i.e. 10+1=11.
2nd Mar 2021, 4:23 PM
Abhay
Abhay - avatar
+ 1
16 is the number representing the number format. Default value is 10
2nd Mar 2021, 4:24 PM
Pawan
Pawan - avatar
0
THX :)
2nd Mar 2021, 4:23 PM
Benjamin S
Benjamin S - avatar