Computer Science, asked by vckckhjf, 9 months ago

What is the use of %s? What is 0x%x?

def __repr__(self):
return "<%s %s %s at 0x%x>" % (type(self).__name__, repr(self.id), repr(self.vsys), id(self))

Answers

Answered by Anonymous
3

Answer:

This is string formatting using old C style format option.

%s is a placeholder for string

0x%x is a placeholder f or hex value. 0x is just prefixing the hex value, without that hex value will look like 800bd001, with 0x it will be 0x800bd001

each of those placeholder will be filled using the values supplied after "%" (last) symbol, in the written order

Answered by BrainlyFIRE
2

Hi mate.......❣️❣️

Answer:

%s is a placeholder for string

0x%x is a placeholder f or hex value. 0x is just prefixing the hex value, without that hex value will look like 800bd001, with 0x it will be 0x800bd001

each of those placeholder will be filled using the values supplied after "%" (last) symbol, in the written order

Similar questions