Python programming: Difference between revisions

From GotOpinion
Jump to navigation Jump to search
m Undo revision 1673 by Paul (talk)
Line 3: Line 3:
=== Python IDE ===
=== Python IDE ===


As I started using Python more I switched to using [https://www.jetbrains.com/pycharm/ PyCharm] by [https://www.jetbrains.com/ JetBrains] for Python IDE. JetBrains has a Community Edition that is free.
In 2016 I started using [https://www.jetbrains.com/pycharm/ PyCharm] by [https://www.jetbrains.com/ JetBrains] for Python IDE. JetBrains has a Community Edition version which is free.


Until 2016 I used [http://pydev.org/ PyDev] for my Python IDE.
Before PyCharm I used [http://pydev.org/ PyDev] for my Python IDE. See [[My PyDev Notes]] section.


=== Escape sequences ===
=== Escape sequences ===

Revision as of 12:28, 7 April 2018

Python basics

Python IDE

In 2016 I started using PyCharm by JetBrains for Python IDE. JetBrains has a Community Edition version which is free.

Before PyCharm I used PyDev for my Python IDE. See My PyDev Notes section.

Escape sequences

Insert list or link to list of escape sequences

Type conversions

int() float()

Conditionals

Operator Conditions when true
x == y x and y have same value
x != y x and y don't have same value
x < y x value is less than y value
x <= y x value is less than or equal to y value
x > y x value is greater than y value
x >= y x value is greater than or equal to y value


string methods (s1 and s2 are strings) conditions when true
s1.startswith(s2) String s1 starts with s2
s1.endswith(s2) String s1 ends with s2
s1.isalnum() All characters in s1 are alphanumeric and there is >= 1 character
s1.isalpha() All characters in s1 are alphabetic and there is >= 1 character
s1.isdigit() All characters in s1 are digits and there is >= 1 character
s1.islower() All cased characters in s1 are lowercase and there is >= 1 cased character
s.isupper() All cased characters in s1 are uppercase and there is >= 1 cased character

Lists, Tuples, Sets, Dicts

to do :: List operations you can perform on each...in a chart...


Sets // fill in later

Operation Method Call Returns

Python operators

Loops

While

How to exit while loop using Enter key

while True:
    i = input("Enter text (or Enter to quit): ")
    if not i:
        break
    print("Your input:", i)
print("While loop has exited")
To Python