100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
PYTHON NOTES FOR STUDENTS... £4.58
Add to cart

Presentation

PYTHON NOTES FOR STUDENTS...

 0 purchase

Discover comprehensive Python notes that cover essential concepts, coding techniques, and practical examples to enhance your programming skills effectively.

Preview 2 out of 6  pages

  • August 12, 2024
  • 6
  • 2022/2023
  • Presentation
  • Unknown
All documents for this subject (16)
avatar-seller
pandeyaarush15022008
Basic Python Revision Notes
With help from Nitish Mittal



HELP from Documentation
dir(module)
help()


Important Characters and Sets of Characters

 tab \t
 new line \n
 backslash \\
 string " " or ' '
 docstring """ """
 comparison operators == , < , > , <= , >= , !=
 Python type boolean True , False.
 Logical operators not , and , or




Order of Operations (from Emory)

Operator Description
() Parentheses (grouping)
f(args...) Function call
x[index:index] Slicing
x[index] Subscription
x.attribute Attribute reference
** Exponentiation
+x, -x Positive, negative
*, /, % Multiplication, division, remainder
+, - Addition, subtraction
in, not in, is, is not, <, <=, >, >=, Comparisons, membership, identity
<>, !=, ==
not x Boolean NOT
and Boolean AND
or Boolean OR

, Variable Names

 case sensitive
 cannot start with a number (ex, 1_assd is not allowed)




Six Steps to Defining a Function

1. What should your function do? Type a couple of example calls.
2. Pick a meaningful name (often a verb or verb phrase): What is a short answer to "What does
your function do"?
3. Decide how many parameters the function takes and any return values
4. Describe what your function does and any parameters and return values in the docstring
5. Write the body of the function
6. Test your function. Think about edge cases.



Integers and Strings
>>> int(45)
45
>>> int('45')
45
>>> str(45)
'45'
>>> str('45')
'45'
>>> int(str(45))
45




Calling Methods
module_name.function_name(x)

 math.sqrt(x)
 random.randrange(2,5)



Conditionals and Branching

 if
 elif
 else

We have a boolean logic expression for if which works when the Boolean evaluates to True

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 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 pandeyaarush15022008. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

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

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

65040 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy revision notes and other study material for 15 years now

Start selling
£4.58
  • (0)
Add to cart
Added