|
Created by Connor Gill
over 6 years ago
|
|
Question | Answer |
PSEUDOCODE | |
SYNTAX | |
PSEUDOCODE | |
SYNTAX |
Image:
Syntax (binary/octet-stream)
|
VARIABLE | |
Data type | |
Boolean | |
Input | An input allows a user to add something to the code for example: what is your favourite colour? They would then answer and then that information will be stored in the code until it is later reset. |
Print allows python to output some text on a screen. Print can output the answer to a mathematical equation. Print can output the content of a list. Print will turn purple if it is done correctly! | |
casting | |
IF – ELIF – ELSE | |
Boolean operations | |
iterations | Iterations are another way of saying loops. Iterations allow users to be able to loop a piece of code over and over again without having to write it down. these come as FOR and WHILE loops. |
while | A while loop statement in Python programming language repeatedly executes a target statement as long as a given condition is true. |
for | The Python for statement iterates over the members of a sequence in order, executing the block each time. Contrast the for statement with the ''while'' loop, used when a condition needs to be checked each iteration, or to repeat a block of code forever. |
In | A list is a data structure in Python that is changeable, ordered sequence of elements. Just as strings are defined as characters between quotes, lists are defined by having values between square brackets [ ] |
Index | simple terms, index() method finds the given element in a list and returns its position. However, if the same element is present more than once, index() method returns its smallest/first position. |
value | The value of some objects can change. Objects whose value can change are said to be mutable; objects whose value is unchangeable once they are created are called immutable. |
append | append() and extend() in Python. Append: Adds its argument as a single element to the end of a list. |
delete | The remove() method removes the item which is passed as an argument. If you need to delete elements based on the index (a specific item), you can use the pop() method. Also, you can use del statement to remove items from a list or delete an entire list. |
Len | len() function is an inbuilt function in Python programming language that returns the length of the string. |
insert | The insert() method inserts an element to the list at a given index. |
There are no comments, be the first and leave one below:
Want to create your own Flashcards for free with GoConqr? Learn more.