100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Summary Cheat sheet python code $3.44   Add to cart

Summary

Summary Cheat sheet python code

 32 views  0 purchase
  • Course
  • Institution

Usefull python operations summarized in one file. Perhaps handy when you easily forget how to work on strings and lists during exam.

Preview 1 out of 2  pages

  • October 28, 2021
  • 2
  • 2021/2022
  • Summary
avatar-seller
Common operations

October 28, 2021


0.1 String operations
• upper() - returns a string in uppercase
• lower() - returns a string in lowercase
• len() - returns the length of a string
• count() - returns the number of occurrences of a string within another string
• replace() - returns a string with specific text replaced
• find() - return the first position where a substring is found, or -1 if it is not found
• strip() - returns a string with all leading and trailing whitespace removed

0.2 Sequence operations
• x in s - true if an item of s is equal to x, else false
• x not in s - false if an item of s is equal to x, else true
• s[i] - ith itom of s, origin 0
• s[i:j] - slice of s from i to j
• s[i:j:k] - slice of s from i to j with step k

0.3 Comparisons
• < - strictly less than
• <= - less than or equal
• > - strictly greater than
• >= - greater than or equal
• == - equal
• != - not equal
• is - object identity
• is not - negated object identity

0.4 Numeric operations
• x+y - sum of x and y
• x-y - difference of x and y
• x*y - product of x and y
• x/y - quotient of x and y
• x//y - floored quotient of x and y
• x%y - remainder of x/y
• int(x) - x converted to integer
• float(x) - x converted to floating point
• x**y - x to the power y

1

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 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 these notes from?

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

Will I be stuck with a subscription?

No, you only buy these notes for $3.44. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

73091 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$3.44
  • (0)
  Add to cart