python - In this function, what is the real meaning of the " * " operator? -


from crypto.cipher import aes import os import base64 import socket import subprocess  block_size = 16 padding='#'  def _pad(data, pad_with=padding):     return data + (block_size - len(data) % block_size) * padding 

i understand character "#" used pad block can't understand meaning of "*", used multiplication.

in python, can multiply string integer repeat string many times. e.g.

'a' * 4 

produces

'aaaa' 

any class can overload operator * implementing specially-named methods.


Comments

Popular posts from this blog

How to check data type in C++? -

javascript - Is getTimezoneOffset() stable during daylight saving transition? -

formula - R: how to pass in a reference to the variable in glm or lm? -