
import tweepy

def authenticatetwitter(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_KEY, ACCESS_SECRET):
    # Authenticate with Twitter using keys and secrets and return
    # an 'api' object
   
    # Authorize with consumer credentials and get an access token 
    # with access credentials
    auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
    auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)
   
    # get an authenticated instance of the API class
    api = tweepy.API(auth)
    
    # return API object 'api'
    return api
    

def sendtweet(api, tweet):
    # Send 'tweet' using Tweepy API function
    api.update_status(tweet)



import tweepy

def authenticatetwitter(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_KEY, ACCESS_SECRET):
    # Authenticate with Twitter using keys and secrets and return
    # an 'api' object

    # Authorize with consumer credentials and get an access token
    # with access credentials
    auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
    auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)

    # get an authenticated instance of the API class
    api = tweepy.API(auth)

    # return API object 'api'
    return api


def sendtweet(api, tweet):
    # Send 'tweet' using Tweepy API function
    api.update_status(status=tweet)

Change the api.update_status() call to explicitly state the 'status' message.
Change the api.update_status() call to explicitly state the 'status' message.

    - A recent version of Tweepy required it to be explicit, no harm in always being so

  
  import tweepy
  
  def authenticatetwitter(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_KEY, ACCESS_SECRET):
      # Authenticate with Twitter using keys and secrets and return
      # an 'api' object
-    
+ 
-     # Authorize with consumer credentials and get an access token 
+     # Authorize with consumer credentials and get an access token
      # with access credentials
      auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
      auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)
-    
+ 
      # get an authenticated instance of the API class
      api = tweepy.API(auth)
-     
+ 
      # return API object 'api'
      return api
-     
+ 
  
  def sendtweet(api, tweet):
      # Send 'tweet' using Tweepy API function
-     api.update_status(tweet)
+     api.update_status(status=tweet)
  
- 
Change the api.update_status() call to explicitly state the 'status' message.
## Code Before:

import tweepy

def authenticatetwitter(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_KEY, ACCESS_SECRET):
    # Authenticate with Twitter using keys and secrets and return
    # an 'api' object
   
    # Authorize with consumer credentials and get an access token 
    # with access credentials
    auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
    auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)
   
    # get an authenticated instance of the API class
    api = tweepy.API(auth)
    
    # return API object 'api'
    return api
    

def sendtweet(api, tweet):
    # Send 'tweet' using Tweepy API function
    api.update_status(tweet)


## Instruction:
Change the api.update_status() call to explicitly state the 'status' message.
## Code After:

import tweepy

def authenticatetwitter(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_KEY, ACCESS_SECRET):
    # Authenticate with Twitter using keys and secrets and return
    # an 'api' object

    # Authorize with consumer credentials and get an access token
    # with access credentials
    auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
    auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)

    # get an authenticated instance of the API class
    api = tweepy.API(auth)

    # return API object 'api'
    return api


def sendtweet(api, tweet):
    # Send 'tweet' using Tweepy API function
    api.update_status(status=tweet)
