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

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -