Small Python School #4

in Steem Schools2 years ago

Small shool, копия (4).png

We continue to study Python. In touch "Little school of learning Python", lesson 4.

Course1

The daily rate is 14-15 minutes.
40-54 minute lesson.

Theses:

  1. There is multiple assignment in programming languages.
  2. Names have no type. Objects have types.
    3.x=y=z=0
  3. Semicolons are allowed in Python. For compactness of the code. But this is not good.
  4. One of the important manifestos of the language is the principle of readability, it should be easy to read.
  5. x,y,x = 1,2,3 card or multiple assignment
  6. PEP8 - if you want to write public code, follow PEP8
  7. Carteges are immutable types.
    9.T=1,2,3,4,5,6
  8. a = T[0]
  9. Elements are numbered from 0
  10. The first element has index 0
  11. a,b,*rest = T
  12. print(T) # (1,2,3,4,5,6)
    15.print(*T)
  13. A tuple is an object that contains links. And the type belongs not to the reference, but to the object itself, to which we
    we refer.
  14. Type annotation is optional.
  15. You can nest parameters of different types in a tuple.
  16. Up to 50 lines, the number of errors is proportional to the number of lines, and then it starts to be out of proportion.

Course2

The daily rate is 1/2-1/3 lessons.

Theses:

  1. Code naming rules - this is important. Only an underscore as code, the first character cannot be a character. You can start with an underscore. You cannot use keywords.
  2. The code is case sensitive.
  3. Variables must convey the meaning of the stored values.
  4. Capital letters are used very rarely, True False
  5. You can name a variable even as a single underscore character.
  6. Capital letters are used to call constants.
  7. In Python, the underscore style is more common.
  8. The second style is "camel style", each new word starts with a capital letter.
  9. It is possible, but highly undesirable, to name Cyrillic variables.
  10. x = input () - input function
  11. By default, the input function will accept any input as text.
  12. Many processes at the processor level are launched when the input function is called. Python is a high-level programming language
  13. \n break to a new line, if put inside quotes, then the user will enter on a new line input('What's your name\n');
  14. name, surname = input().split()
  15. map function - display the action on all elements of some sequence. x,y = map(int,input().split())
    16.print('Hello');

First lesson: https://steemit.com/hive-152587/@alexmove.witness/small-python-school-1
Second lesson:
https://steemit.com/hive-152587/@alexmove.witness/small-python-school-2
Third lesson: https://steemit.com/hive-152587/@alexmove.witness/small-python-school-3

Small Python School Support Chat:
https://t.me/+lQtdzunysoxhOTgy

Thanks for studying.
Thank you for your attention.
Have a good day!

Coin Marketplace

STEEM 0.18
TRX 0.14
JST 0.029
BTC 57956.22
ETH 3126.99
USDT 1.00
SBD 2.45