< Return to Video

[Language skills Python] Expressions vs Statements [Tutorial]

  • 0:00 - 0:04
    PROFESSOR: Let's learn
    another important key term.
  • 0:04 - 0:06
    Well, two for that matter.
  • 0:06 - 0:10
    One is expressions and the
    other one is statements.
  • 0:10 - 0:13
    You're going to hear this a lot
    when talking to programmers.
  • 0:13 - 0:15
    So what do they mean?
  • 0:15 - 0:16
    Let's have a look.
  • 0:16 - 0:22
    If we create a piece of code
    here, let's just say IQ is 100,
  • 0:22 - 0:23
    IQ has lowered.
  • 0:23 - 0:32
    And then let's say user age is
    going to equal IQ divided by 5.
  • 0:32 - 0:36
    An expression is this
    part of the code.
  • 0:36 - 0:42
    It's a piece of code
    that produces a value.
  • 0:42 - 0:45
    In our case, this
    produces a value.
  • 0:45 - 0:50
    Because 100 divided by
    5 is going to equal 20.
  • 0:50 - 0:53
    So this is an expression.
  • 0:53 - 0:56
    A statement, on
    the other hand, is
  • 0:56 - 1:00
    an entire line of code,
    not this entire thing,
  • 1:00 - 1:05
    but an entire line of code that
    performs some sort of action.
  • 1:05 - 1:08
    In this case, what
    action are we performing?
  • 1:08 - 1:13
    Well, the action is that we're
    calculating 100 divided by 5
  • 1:13 - 1:17
    and then assigning that value
    to the variable-- user age.
  • 1:17 - 1:21
    So this is an expression.
  • 1:21 - 1:24
    This is a statement.
  • 1:24 - 1:28
    And also this is
    another statement.
  • 1:28 - 1:30
    So if you hear me
    mentioning these terms
  • 1:30 - 1:33
    throughout the course,
    hopefully, now you
  • 1:33 - 1:34
    know what they mean.
  • 1:34 - 1:35
    I'll see you in the next one.
  • 1:35 - 1:36
    Bye-bye.
  • 1:36 - 1:37
Title:
[Language skills Python] Expressions vs Statements [Tutorial]
Description:

more » « less
Video Language:
English
Duration:
01:37

English subtitles

Revisions