1/39
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
Data type
A classification that specifies what kind of value a variable can hold
all data types used in Python
Integer, string, float, Boolean, list, tuple, dictionary
What is GUI?
Graphical User Interface- a visual way for people to interact with computers using icons, ect.
What is a widget?
A building block of the GUI, like a button or label that users can see or interact with
What is iteration and what are the loops in Python
Iteration is the repetition of code for, while
Sequence
These are the steps a program must follow to complete the task
Selection
if elif else- if it doesn't meet if criteria it moves onto elif, if it doesn't meet elif it goes to else
What is a function?
A block of code that performs a specific task and can be reused
three main constructs
Sequence, Selection, Iteration
What is tkinter
a library within Python
Library
Built-in code that has been pre-written and tested with specific functions. For example, random library and Tkinter library
Element
elements that we can use are text boxes, labels and buttons these are known collectively as widgets. A label that text has been added onto
Label
a label is a widget used for display only. The user cannot interact with it
Method
a prewritten function that belongs to an object: e.g. widgets: entry, labels, buttons ect
CLI
Command line interface- a text based interface where you can interact with the computer operating system
Entry
A small interaction that where the user can enter something
Function
A piece of code that carries out something. You can use it many times in one code
Button
A clickable button that you can click to interact with
Text
A bigger box for users to type multiple lines of text
Frame
A box or container that groups other widgets
String
Sequence of characters
integer
Numeric- whole number
float
Number- decimal
Boolean
True or false
tuples
Data type they can store strings, integers and other data. Unlike a variable they can store multiple pieces of data. The data stored cannot be changed. The first value is 0 uses normal brackets ()
list
Similar to tuple but can change. Items can be stored, updated, deleted or added uses square brackets []
Dictionaries
Similar data type however we supply our own indexes. In a dictionary an index is called a key uses curly brackets {}
For loop
A for loop is count controlled - e.g. "For 10 seconds I will jump up and down".The loop will continue until the count (e.g. 10 seconds) has finished.
for i in range(5):
print("This is a loop!")
While loop
A while loop is condition controlled - e.g. "While I am not out of breath, I will jump up and down."The loop will continue as long as the condition remains true.
Example of Selection
If age < 13 output child, else if > 13 and < 20 output teenager, else output adult
Subroutine/functions
These are smaller parts of a program that have a specific purpose
.get() method
The .get() method will allow user input to be sent to the program
First, I want to store the user input into a variable called name
.delete() method
A method used to remove a specified key and its associated value from a data structure.
.insert() method
A method used to add a new element at a specified position in a data structure, such as a list or an array.
What is the foundational element of the Tkinter GUI?
The window
Entry widget methods
Retrieving text .get()
Deleting text .delete()
Inserting text .insert()
Casting
Changing one data type into another
What does slicing do?
Takes a part of a string or list
Try and except
Try allows you to test the code for errors
The accept block allows you to fix those errors
How to identify a subroutine
Any function defined with def is a subroutine