How to call a function with two arguments in python

后端 未结 3 1603
名媛妹妹
名媛妹妹 2021-01-29 15:48

i wanna ask about how to call a function with two arguments in python. for example,
code below is an example i want to call color function.

def color(objec         


        
3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-29 16:52

    def color(object,arg2):
        blue = '\033[1;34m'+object+'\033[1;m'
        red = '\033[1;31m'+arg2+'\033[1;m'
        return blue + red
    tes = 'this must be blue'
    tes_2 = 'i wanna this string into red!!' 
    print color(tes,tes_2)
    

    I think you should visit Python2.7 Tutorial

提交回复
热议问题