color_list = ["Red","Green","White" ,"Black"]
print( "%s %s"`%(color_list[0],color_list[-1])`)
what does % operator referred in python. what is the purpose to use?
color_list = ["Red","Green","White" ,"Black"]
print( "%s %s"`%(color_list[0],color_list[-1])`)
what does % operator referred in python. what is the purpose to use?
check out the official python documentation
String Formatting
s % obj
mod(s, obj)
https://docs.python.org/3/library/operator.html
and don't confuse it with the modulo operator