Created
March 16, 2023 01:53
-
-
Save cemkaplan75/bcd93993f4ed530ab33c98c818a7bcfc to your computer and use it in GitHub Desktop.
Fintech_Class_Assignment 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#That is a manipulation list. | |
# Press Shift+F10 to execute it or replace it with your code. | |
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings. | |
# I'm creating a stock tickers list here | |
stock_tickers = ["AMZN", "CSCO", "FB", "GOOG", "INTC", "MSFT", "SQ", "TWTR", "WRK"] | |
print(stock_tickers) | |
#Updating the ticker 'WRK' to 'WORK'. Printing stock_tickers to confirm my code. | |
stock_tickers[8] = "WORK" | |
print(stock_tickers) | |
#Adding the ticker 'ZM' to the end of the stock_tickers list. Printing stock_tickers to confirm my code. | |
stock_tickers.append("ZM") | |
print(stock_tickers) | |
#Adding the ticker 'AAPL' to the beginning of the stock_tickers list. Printing stock_tickers to confirm my code | |
stock_tickers.append("AAPL") | |
print(stock_tickers) | |
#Adding the ticker 'DELL' so that it appears between 'CSCO' and 'FB'. Printing stock_tickers to confirm my code. | |
stock_tickers.insert(2,"DELL") | |
print(stock_tickers) | |
#Removing the ticker 'INTC' from the stock_tickers list. Printing stock_tickers to confirm my code. | |
stock_tickers.remove("INTC") | |
print(stock_tickers) | |
#Remove the ticker 'SQ' from the list using the pop() method. Print stock_tickers to confirm your code. | |
stock_tickers.pop(6) | |
print(stock_tickers) | |
#Slicing a section of the list that includes the tickers 'CSCO', 'DELL', 'FB', and 'GOOG'. | |
# Set this equal to a variable called stock_tickers_slice. Print the new variable to confirm my code. | |
stock_tickers_slice = stock_tickers[1:5] | |
print(stock_tickers_slice) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment