Checking if two values are equal in PSeInt (=)
Asks whether two values are equal and answers true or false. Used in conditions, as in Si or Mientras.
- Group:
- Relational
- Template
=
Opens the editor with this example loaded. Run it step by step and watch the flowchart.
Worked example
A complete algorithm, ready to copy and run.
Algoritmo Example Escribir "Ana" = "ana"FinAlgoritmoOutput
Shows: FALSO (upper and lower case count as different)
This is what the console shows when the example runs.
FALSOCommon mistake
= compares; to store a value in a variable use <-.
Good to know
You can also write == to compare.
In a flowchart
This is how it appears in a flowchart, with the same shapes Codoritmo draws.
Template
The general form. Replace what's inside < > with your own data.
=Examples that use it
Programs from the example library where it appears, from the simplest to the most complete.
Coffee Shop Menu
Pick a drink from the menu and get the total to pay.
BeginnerName Initials
Gets the initials of a full name.
BeginnerParking Fee
Charges every started hour, with a daily maximum.
IntermediateGuess the Number
Guess a secret number from 1 to 100 in seven tries.
IntermediateLinear Search
Finds a name in a list, ignoring upper and lower case.
IntermediateStore Inventory
Records the stock of each product and flags what to restock.
Intermediate
More relational
Codoritmo is an independent, open-source project inspired by PSeInt and compatible with its syntax. It is not affiliated with the PSeInt project. Official PSeInt website.