Twillio Restclient in python
Question: I'm Using Twilio Rest API in python to send sms , Below is the code I'm using
to send SMS

SMS was being sent successfully by below code but I want body of text to be
declared as a variable. For example if I declare `ABC = "Test message"` then
body should be `Test message`.

    
    
    from twilio.rest import TwilioRestClient
    
    ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXX"
    AUTH_TOKEN = "YYYYYYYYYYYYYYYYYY"
    
    client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
    
    message = client.messages.create(
        body="Hello World!",  
        to="+12125551234",
        from_="+15105551234",
    )
    print message.sid
    

If I use body = "ABC" it's sending message as "ABC" by sms i want declare
variable in this case ABC = "Test Message " i want Body as Testmessage

    
    
    message = client.messages.create(
        body="Hello Monkey!",  # Message body, if any
        to="+12125551234",
        from_="+15105551234",
    )
    print message.sid
    

Is there any way to send declare variable as Message.


Answer: Hi if you write anything in a "" (string) then it will be treated as a String.
You should modify your code like below:

    
    
    text =  "Test Message"
    message = client.messages.create(
        body= text,
        to="+12125551234",
        from_="+15105551234",
    )
    print message.sid
    

Basically you should assign the variable `text` to `body` so now body is "Test
Message"

