Python: Operators

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

Equality operators

==: tests weather two values (operands) are equal and returns true if they are (false otherwise) !: tests weather two values (operands) are different or not equal and returns true if they are not equal (false otherwise)

String

A data type that represents a sequence of characters and cant be changed.

Lists

A list is a sequence of values that can be changed.

Random Numerbs

A random number generator used in programming languages to let those numbers impact the model.

The syntax for a loop

Always terminates at the end of the sequence

Syntax for the if-else statement

An if statement may include an optional else clause, if making it an if-else statement. An else clause consists of the reserved word else followed by another statement.

While Statement

Evaluates a Boolean expression and executes a statement (or block of statements) if the expression is true. If the statements or statement are executed, the Boolean expression is evaluated again, and again, and so on.

Logical OR

If any of the two operands are non-zero then condition becomes true. Ex: (a or b) is true.

Logical AND

If both the operands are true then condition becomes true. Ex: (a and b) is true.

The infinite Loop

If the Boolean expression never evaluates to false, the loop will never end, and go on forever.

Rational operators

The rational operators could also be called the inequality operators. They work similarly to Algebra. < less than <= less than or equal to > greater than >= greater than or equal to

Logical operators

Used to combine the results given by relational operators. Using this operator you are able to combine multiple tests into a single test.

Logical NOT

Used to reverse the logical state of its operand. EX: (a and b) is false.

Sequences

When storing data as a collection of values, it is saved in sequences. They are ordered collection of values.


Set pelajaran terkait

Lesson 2 Estructura 2.2 Forming questions in Spanish Review

View Set

INS3003 Final Wahhabism to Militant Jihadism

View Set

Marketing Learning Objectives Unit 1

View Set

Psych Exam 1 - Ch. 3 (Psychobiology & Psychopharmacology)

View Set

Frankenstein Chapter 5-10 Vocabs

View Set

Macroeconomics: Unit 4 -Module 9:

View Set