Python learning story 1 variables

  1.  there is no difference between single quote and double quote

1

if you want single quote included, you can use double quotes to enclose it, vice versa.

1

2.  basic rules

1

3. triple quotes

triple quotes helps to add break or line instead of inputing \n, in this example, triple quotes also can show special characters.

One thing need to be mentioned, in python, it cannot be 4 quotes in one line, so we need to add a space.(red part in pic)

1

4. cannot print string with number together in Python

1

5. division / or //

1.PNG

Here is one example for loop:

1

6.

1

Notice :

we can use negative number as a trick here, but we cannot put parrot[-4:2], like negative and positive number together, it would be an error.

as for skip, how i think :

2.PNG

More examples:

1

7. one trick which I feel funny

1

Looks so easy and funny, O(∩_∩)O

8. One operator to check substring to another

1

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s