Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Engineering LibreTexts

Search

  • Filter Results
  • Location
  • Classification
    • Article type
    • Author
    • Set as Cover Page of Book
    • License
    • Show TOC
    • Transcluded
    • OER program or Publisher
    • Autonumber Section Headings
    • License Version
    • Print CSS
  • Include attachments
Searching in
About 563 results
  • https://eng.libretexts.org/Bookshelves/Computer_Science/Programming_Languages/Python_for_Everybody_(Severance)/06%3A_Strings/6.05%3A_Strings_are_immutable
    It is tempting to use the operator on the left side of an assignment, with the intention of changing a character in a string. The "object" in this case is the string and the "item" is the character yo...It is tempting to use the operator on the left side of an assignment, with the intention of changing a character in a string. The "object" in this case is the string and the "item" is the character you tried to assign. For now, an object is the same thing as a value, but we will refine that definition later. The reason for the error is that strings are immutable, which means you can't change an existing string. The best you can do is create a new string that is a variation on the original:
  • https://eng.libretexts.org/Bookshelves/Computer_Science/Programming_Languages/Python_for_Everybody_(Severance)
    Writing programs (or programming) is a very creative and rewarding activity. You can write programs for many reasons, ranging from making your living to solving a difficult data analysis problem to ha...Writing programs (or programming) is a very creative and rewarding activity. You can write programs for many reasons, ranging from making your living to solving a difficult data analysis problem to having fun to helping someone else solve a problem. This book assumes that everyone needs to know how to program, and that once you know how to program you will figure out what you want to do with your newfound skills.
  • https://eng.libretexts.org/Courses/Delta_College/Introduction_to_Programming_Concepts_-_Python/07%3A_Files/7.05%3A_Searching_through_a_File
    Since find looks for an occurrence of a string within another string and either returns the position of the string or -1 if the string was not found, we can write the following loop to show lines whic...Since find looks for an occurrence of a string within another string and either returns the position of the string or -1 if the string was not found, we can write the following loop to show lines which contain the string "@uct.ac.za" (i.e., they come from the University of Cape Town in South Africa):
  • https://eng.libretexts.org/Courses/Delta_College/Introduction_to_Programming_Concepts_-_Python/08%3A_Lists/8.11%3A_Objects_and_Values
    To check whether two variables refer to the same object, you can use the is operator.
  • https://eng.libretexts.org/Courses/Delta_College/Introduction_to_Programming_Concepts_-_Python/09%3A_Dictionaries/9.7%3A_Dictionaries_(Exercises)
    After all the data has been read and the dictionary has been created, look through the dictionary using a maximum loop (see Section [maximumloop]) to find who has the most messages and print how many ...After all the data has been read and the dictionary has been created, look through the dictionary using a maximum loop (see Section [maximumloop]) to find who has the most messages and print how many messages the person has. Exercise 5: This program records the domain name (instead of the address) where the message was sent from instead of who the mail came from (i.e., the whole email address).
  • https://eng.libretexts.org/Courses/Delta_College/Introduction_to_Programming_Concepts_-_Python/04%3A_Functions/4.13%3A_Functions_(Exercises)
    Exercise 4: What is the purpose of the "def" keyword in Python? c) It indicates that the following indented section of code is to be stored for later Exercise 6: Rewrite your pay computation with time...Exercise 4: What is the purpose of the "def" keyword in Python? c) It indicates that the following indented section of code is to be stored for later Exercise 6: Rewrite your pay computation with time-and-a-half for overtime and create a function called computepay which takes two parameters (hours and rate). Exercise 7: Rewrite the grade program from the previous chapter using a function called computegrade that takes a score as its parameter and returns a grade as a string.
  • https://eng.libretexts.org/Courses/Delta_College/Introduction_to_Programming_Concepts_-_Python/14%3A_Object-Oriented_Programming/14.08%3A_Many_Instances
    The constructor has both a self parameter that points to the object instance and then additional parameters that are passed into the constructor as the object is being constructed: Copies the paramete...The constructor has both a self parameter that points to the object instance and then additional parameters that are passed into the constructor as the object is being constructed: Copies the parameter that is passed in (nam) into the name attribute within the object instance. The output of the program shows that each of the objects (s and j) contain their own independent copies of x and nam:
  • https://eng.libretexts.org/Courses/Delta_College/Introduction_to_Programming_Concepts_-_Python/16%3A_Visualizing_data
    So far we have been learning the Python language and then learning how to use Python, the network, and databases to manipulate data. In this chapter, we take a look at three complete applications that...So far we have been learning the Python language and then learning how to use Python, the network, and databases to manipulate data. In this chapter, we take a look at three complete applications that bring all of these things together to manage and visualize data. You might use these applications as sample code to help get you started in solving a real-world problem. Each of the applications is a ZIP file that you can download and extract onto your computer and execute.
  • https://eng.libretexts.org/Courses/Delta_College/Introduction_to_Programming_Concepts_-_Python/12%3A_Networked_Programs/12.07%3A_Parsing_HTML_using_BeautifulSoup
    The program prompts for a web address, then opens the web page, reads the data and passes the data to the BeautifulSoup parser, and then retrieves all of the anchor tags and prints out the href attrib...The program prompts for a web address, then opens the web page, reads the data and passes the data to the BeautifulSoup parser, and then retrieves all of the anchor tags and prints out the href attribute for each tag. # Retrieve all of the anchor tags tags = soup('a') for tag in tags: # Look at the parts of a tag print('TAG:', tag) print('URL:', tag.get('href', None)) print('Contents:', tag.contents[0]) print('Attrs:', tag.attrs)
  • https://eng.libretexts.org/Courses/Delta_College/Introduction_to_Programming_Concepts_-_Python/15%3A_Using_Databases_and_SQL/15.05%3A_Structured_Query_Language_summary
    The INSERT statement specifies the table name, then a list of the fields/columns that you would like to set in the new row, and then the keyword VALUES and a list of corresponding values for each of t...The INSERT statement specifies the table name, then a list of the fields/columns that you would like to set in the new row, and then the keyword VALUES and a list of corresponding values for each of the fields. The UPDATE statement specifies a table and then a list of fields and values to change after the SET keyword and then an optional WHERE clause to select the rows that are to be updated.
  • https://eng.libretexts.org/Bookshelves/Computer_Science/Programming_Languages/Python_for_Everybody_(Severance)/13%3A_Python_and_Web_Services/13.02%3A_Looping_through_Nodes
    Often the XML has multiple nodes and we need to write a loop to process all of the nodes. In the following program, we loop through all of the user nodes:

Support Center

How can we help?