Fichas
CS

Fichas del conjunto (27)
- 1PSEUDOCODEa notation resembling a simplified programming language.

- 2SYNTAXSyntax Errors are the easiest to fix
These happen when you have typed some invalid code.
Syntax Analysis: Tokens are checked to see of they match the rules (or syntax) for the language used. - 3VARIABLEVariable is any named type of storage.
E.g. myname = input("Name:")
myage = 14
lastname = "Wilde" - 44. DATA TYPETypes of data.
Integers.
Floating-Point Numbers.
Complex Numbers.
Strings. Escape Sequences in Strings. Raw Strings. Triple-Quoted Strings. - 5STRINGString literals in python are surrounded by either single quotation marks, or double quotation marks. Strings can be output to screen using the print function. For example: print("hello")
- 6INTEGERDefined as int. Represents a whole number value. E.g. age = input(int("Age:"))
- 7FLOATfloat (floating point real values) − Also called floats, they represent real numbers and are written with a decimal point dividing the integer and fractional parts
- 8BOOLEANdenoting a system of algebraic notation used to represent logical propositions by means of the binary digits 0 (false) and 1 (true)
- 9INPUTSomething that gives a computing device data. E.g. Mouse, Keyboard...
- 10PRINTPrint is a function that when told to in the code, will display text.
E.g. print("Hello")
OUTPUT:
Hello - 11CASTINGCasting is when you convert a variable value from one type to another. This is, in Python, done with functions such as int() or float() or str() .
- 12IF...ELIF...ELSEThe if…elif…else statement is used in Python for decision making.
if 100 == 100
print("okay")
elif 100 == 50:
print("no")
else:
print("never") - 13BOOLEAN OPERATORS
- 14ANDa Boolean operator which gives the value one if and only if all the operands are one, and otherwise has a value of zero.

- 15ORa logical operation which gives the value one if at least one operand has the value one, and otherwise gives a value of zero.

- 16NOTA NOT gate performs logical negation on its input. In other words, if the input is true, then the output will be false.

- 17ITERATIONIteration, in the context of computer programming, is a process wherein a set of instructions or structures are repeated in a sequence a specified number of times or until a condition is met. When the first set of instructions is executed again, it is called an iteration.
- 18CONDITIONThe boolean expression after the if statement is called the condition. If it is true, then all the indented statements get executed.
- 19RANGEThe possible values that may be stored in a variable. The upper and lower bounds of an array. An alternative to iterator.
- 20WHILEWith the while loop we can execute a set of statements as long as a condition is true.
E.g. choice = "Y"
while choice != "N"
(the following will happen) - 21FORA for loop is a loop that happens but adds one every time.
E.g.
For i in range - 22LISTSList is a collection which is ordered and changeable. Allows duplicate members.
E.g.
colours=["pink","blue","red"] - 23INDEXindex method finds the given element in a list and returns its position.
- 24VARIABLEVariables are nothing but reserved memory locations to store values. This means that when you create a variable you reserve some space in memory.
- 25APPENDWhen you want to add something to a list you use the function append.
E.g. animal.append("pig") - 26REMOVEWhen you want to remove something from a list you use the remove function.
E.g.
animals.remove("pig") - 27LENlen() function is an inbuilt function in Python programming language that returns the length of the string.
E.g.
for i in range [0,len(students)
Información
- Descripción
- Fichas sobre CS, creado por Kya Wilde el 19/03/2019.
- Creado por
- Kya Wilde
- Visitas
- 5
- Valoración