Conventions used
There are a number of text conventions used throughout this book.
Code in text
: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “In this example, the tweet in question is RT @robdv: $TWTR now top holding for Andor, unseating $AAPL. ”
A block of code is set as follows:
tweet = "RT @j_o_n_dnger: $TWTR now top holding for Andor, unseating $AAPL" words_in_tweet = tweet.split(' ') # list of words in tweet for word in words_in_tweet: # for each word in list if "$" in word: # if word has a "cashtag" print("THIS TWEET IS ABOUT", word) # alert the user
Bold: Indicates a new term, an important word, or words that you see onscreen. For instance, words in menus or dialog boxes appear in bold. Here is an example: “The words_in_tweet variable tokenizes the tweet (separates it by word).”
Tips or important notes
Appear like this.