100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Introduction to Programming: Strings Notes R120,00
Add to cart

Class notes

Introduction to Programming: Strings Notes

 0 purchase

Lecture notes on strings combined with notes from recommended textbook for course.

Preview 1 out of 4  pages

  • June 6, 2023
  • 4
  • 2022/2023
  • Class notes
  • James gain
  • Strings
All documents for this subject (3)
avatar-seller
aqeelahismail
Lecture 1: Intro to Strings
Strings:
Strings = sequence of characters (letters, digits, symbols).
e.g. “howzit %*&_^96”
 String literals  enclosed in ‘ ’ or “ ”
 Can use escape characters within strings if necessary.
 Data type = string
 Strings have methods for various useful functions (because strings are objects).
o Object = a data type that combines state (data) and behaviour (code).

How Python stores Strings:
 String = sequence of characters (characters = internally a single number which represents some
symbol).
 Mapping from numbers to symbols = Unicode
o A standard for electronic data.
o Unicode  thousands of symbols defined to cater all languages.




Internal data vs Input/Output:




Processing Strings:
 To join strings together:
+
e.g. “hello” + “ “ + “world”  “hello world”
 To multiply a string:
*
e.g. “hello” * 2  “hellohello”
 To determine the length of a string:
len()
e.g. len(“hello”)  5
Indexing a String:
 Index is used to read a single character from a string (we can only read, we cannot change
characters).
 Syntax:

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through EFT, credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying this summary from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller aqeelahismail. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy this summary for R120,00. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

75341 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy summaries for 15 years now

Start selling
R120,00
  • (0)
Add to cart
Added