Thursday, January 24, 2019

the number is even

x is 100

FalseandTrueTrueFalseFalse
>> True
>> False
>> False
>> False
and
>> True
orTrueTrue
>> True
>> True
>> False
>> False
andor
>> True
True1==1TrueFalsenotTrueFalsenot
>> False
>> True
Conditional Statements ifelifelseconditional statementscontrol structurepseudocodeTruecode_area1Falsecode_area2if-statementelse-statementif-else statementif-else statement
>> Hello, America!
if-statementif-statementifTrueelse-statementelse-statementelseif-statementFalseif-else statementHello, America!if-statementTruehomeCanadaif-statementFalseelse-statementHello, World!
>> Hello, World!
if-statement
>> Hello, America!
if-statement
>> The number is 2.
>> The number is even.
if-statementTrueTrueFalseif-statementif-statement
>> 21
x + yif-statementsTrueelse-statementif-else statementelifelif-statementselifelif-statementsif-else statementif-else statementelif-statementsif-statementTrueFalseelif-statementelif-statementTrueelif-statementsTrueelse-statementif-else statementelif-statements
>> Hello, Thailand!
elif-statementsTrueelse-statement
>> Hello, World!
if-statementselif-statements
>> I dont know!
>> x is 100!
>> x is even!
Statements statementsimple statementscompound statements
>> Hello, World!
>> 4
if-statementsif-else statementsHello, World!clausesheadersuite(s)Hello, World!
>> Hello, World!
>> Hello, World!
>> Hello, World!
forprint("Hello, World!")Hello, World!if-else statementsif-statementelse-statementif-elseif-statementTrueif-statementelse-statementif-statementFalseif-statementelse-statement
>> I dont know!
>> x is 100!
>> x is even!
>> Michael
>> Jordan
Vocabulary Comment
Keyword
Data type
Object
Str
Stringstr
Character
Int
Integerint
Float
Floating-point numberfloat
Bool
BooleanboolTrueFalse
NoneType
NoneNoneTypeNone
Constant
Variable
Assignment operator=
Increment
Decrement
Syntax
Syntax error
Exception
Operator
Arithmetic operator
Operand
Expression
Order of operations
Comparison operatorTrueFalse
Logical operatorTrueFalse
Conditional statement
Control structure
Pseudocode
if-else statement
if-statementif-else statement
else-statementif-else statement
elif-statementif-else statement
Statement
Simple statement
Compound statement
Clause
Header
Suite Challenges




ageage

Chapter 4. Functions

"Functions should do one thing. They should do it well. They should do it only."
~ Robert C. Martinfunctions Representing Concepts conventionprint("[what_you_want_to_print]") Functions Callingparameterfxx[function_name]([parameters_separated_by_commas])f(x) = 2 * xf(2)4f(10)20 Defining Functions function f(x) = x * 2defdeflike_thisreturn x * 2return[function_name]([parameters_separated_by_commas])f2print
>> 4
>> z is 5