Start To Learn

Programming

Minimum

  • DevOps Engineer
    • www.escapex.com
    • www.fastweb.com.cn
  • Software Engineer
    • www.onwardsecurity.com
    • www.iii.org.tw
    • www.sunplus.com

Lesson 1

Data Type

I have 12 dollars.

I have 12 dollars.

  • Sentence
  • Number
  • Character
  • Punctuation
  • Whitespace

Number

  • Integer
  • Float

String

  • Sentence
  • Character
  • Punctuation
  • Whitespace

Lesson 2

Python Data Type

  • Number

    • Integer

    • Float

  • String

  • Boolean

  • List

  • Dictionary

  • Tuple

  • Set

  • ...

  • etc.

Online Terminal

Number

Built-in

  • type( )
  • int( )
  • float( )
> 1

> 2.2

> type(1)

> type(2.2)

> int

> float

String

Built-in

  • str( )
> 'a'

> "hello"

> type('a')

> str

Boolean

Built-in

  • bool( )
> True

> False

> type(True)

> bool

List

Built-in

  • list( )
> []

> list()

> ['a','b']

> type(['a','b'])

> list

Dictionary

Built-in

  • dict( )
> {}

> dict()

> {'a': 97, 'b': 98}

> type({'a': 97,'b': 98})

> dict

Tuple

Built-in

  • tuple( )
> ()

> tuple()

> (1, 2, 3)

> type((1, 2, 3))

> tuple

Set

Built-in

  • set( )
> set()

> set((1, 2, 1))

> type(set((1, 2)))

> set

Brainstorm

# What data type is?
> 1, 2

# Try any complicated combination
> [1, '2', (3, 4), [5, 6]]

Reference

Lesson 3

Operator

Number

> 1 + 1

> 2 - 3

> 3 * 4

> 5 / 3

> 5 // 3

> 5 % 3

> 6 ** 2
> 1 > -1

> 2 < 3

> 3 == 3

> 4 >= 3

> 4 <= 5

> 5 != 6

> 6 is 6

> 6 is not 7

String

> 'hello ' + 'world'

> 'hi' != 'hello'

> 'wordpress' > 'word'

> 'hello world'.startwith('hello')

> 'hello world'.index('o')

> 'he' in 'hello'

> len('hello')

Boolean

# Condition
> not True

# Simulate multiple conditions
> True and False

> True or False

# irregular expressions
> True + True

> False + False

List

> [1,3] + [2,4]

> var = [1,3]
  var.extend([2,4])
  var

> var.append([5])

# getter
> var[1]

# setter
> var[4] = 5

> var.index(1)
> sorted(var)

> 1 in var

> var.remove(1)

> del(var[1])

Dictionary

> var = {'a': 97}

# getter
> var['a']

# setter
> var['b'] = 98

> var.get('b')

> var.update({'b': 99})

> del(var['b'])

Reference

Reference

Appendix

Resource

Follow Tutorial

Style Guide

Online IDE