Converting coins to USD I'm using 2 objects inside my class. My actions are almost identical, however I want to return 2 different data types and both are slightly different from each other.

import requests


class coins:

    def coins_arr(self):
        params = {'limit': 10, 'convert': 'USD'}
        data = requests.get('https://api.coinmarketcap.com/v1/ticker/?%s' % params).json()
        coinsData = []
        for objects in data:
            for k in objects.keys():
                if k == 'id':
                    coinsData += objects[k].split()
        #returns array of coin names 
        return sorted(coinsData)



    def coins_dict(self):
        params = {'limit': 10, 'convert': 'USD'}
        data = requests.get('https://api.coinmarketcap.com/v1/ticker/?%s' % params).json()
        coinsDict = {}
        for objects in data:
            for k,v in objects.items():
                if k == 'id':
                    coinsDict.update({objects[k]:objects['price_usd']})
        #returns dictionary with name:price   
        return coinsDict

d = coins()

print (d.coins_arr())


I thought of returning the coins_dict.keys(), but it won't return me it in a sorted order. I am not sure if I can implement a lambda function when I call the class object.
First things first, the convention is to use uppercase-initial for class names.

All modules, functions, classes and methods should have docstrings.

According to their API documentation, if limit is not specified, the default is 100 and by default convert is 'USD'. Your coins_arr() method is returning 100 coins, not 10, which I think is due to an incorrect formatting of the placeholder in the URL you are passing to requests.get(). You are splitting each coin and concatenating it to coinsData, which is not necessary since you just need to append it to the list.

The coins_dict() method is also returning 100 coins, not 10.

There is also some repetition in the two methods, which you could avoid.

Here I would write the class, like so:

import requests

class Coins:
    """This is a class for cryptocurrencies."""

    def __init__(self, url, limit=10):
        self.url = url        
        self.limit = limit
        self.data = requests.get(self.url.format(self.limit)).json()

    def get_coins(self):
        """Return a sorted list of cryptocurrencies."""        

        coins = sorted(v for obj in self.data                       
                       for k, v in obj.items() if k == 'id') # sorted() returns a list

        return coins

    def get_coins_prices(self):
        """Return a dictionary of cryptocurrencies and their prices."""        

        coins_prices = {obj[k]: obj['price_usd'] for obj in self.data
                        for k, v in obj.items() if k == 'id'}

        return coins_prices

if __name__ == '__main__':
    url = 'https://api.coinmarketcap.com/v1/ticker/?limit={}'

    obj_a = Coins(url)
    print(obj_a.get_coins())

    obj_b = Coins(url)
    print(obj_b.get_coins_prices())

    obj_c = Coins(url, limit=5) # Setting limit to 5 results
    print(obj_c.get_coins_prices())


The Python version used to test the above code is 3.6.

Hope that helps.