# data[].attributes.body
R:\IT & Computing\PYTHON\!!!!PYTHON VIDEOS

# data[].attributes.body
R:\IT & Computing\PYTHON\!!!!PYTHON VIDEOS

# data[].attributes.body
R:\IT & Computing\PYTHON\!!!!PYTHON VIDEOS

# data[].attributes.body
R:\IT & Computing\PYTHON\!!!!PYTHON VIDEOS

# data[].attributes.attachment_link.title
Step 12_Exam Question  Spec 3 Q06 Answer

# data[].attributes.headline
DOWNLOAD STUDENT CODE FILE AND THEN COMPLETE

# data[].attributes.subject
DOWNLOAD STUDENT CODE FILE AND THEN COMPLETE

# data[].attributes.attachment_link.title
Step 12_Exam Question  Spec 3 Q06 Student

# data[].attributes.headline
STEP 11- POND LIFE EXTENSTION- FILE INTEGRATION

# data[].attributes.subject
STEP 11- POND LIFE EXTENSTION- FILE INTEGRATION

# data[].attributes.body
a) In your z: drive create a text file called "pondexport.txt"
b) Add an option to the menu called "Press 5 To Export To File "
c) Create a new subprogram called export
d) Create code in that subprogram that exports all the data in data array to this file
e) make sure you add open, write and close commands
f) use the PLS to help youi

# data[].attributes.attachment_link.readable_text
status="True"
#A new list called data should be created and it should have no data in it at the start
data=[["pond",1052022,"fish","cod",0.78,256],["sea",4052022,"fish","barracuda",1.78,956]]

#Ask the user for the data using a mix of strings, integer and decimal inputs e.g. data such as location, date, species, name, length and weight.

def menu():
    print("Welcome to the Aqautic Centre in Plymouth")
    print ("Choose 1 to enter new data, Choose 2 and it will show lenghths of species, Choose 3 to search and Choose 4 to exit")
    choice=input("Enter choice")
    if choice=="1":
        #Enter selected subprogram
        
    elif choice=="2":
        #Enter selected subprogram
        
    elif choice=="3":
        #Enter selected subprogram
        
    elif choice=="4":
        #Enter selected subprogram
    

def species_input():
    sp_location=input("What is the location of the find: ")
    sp_date=input("What is the date of the find: e.g. 1st May 2022 would be 1052022 ")
    sp_species=input("What is the species of the find?:")
    sp_name=input("What is the name of the find: ")
    sp_length=float(input("What is the length of the find: "))
    sp_weight=float(input("What is the weight of the find"))
    #Enter selected code to join fields into a new record
 

def species_len():
        #ask for specieise.,g. integer
        target = input("What species are you looking for?:" )      
        #iterate through array- i&j


                #selection if item= id
                if (data[i][j] == target):
                    #will print thye specieies name and length
                    print("Our records show a ",data[???][??],"and is:", data[??][??],"mm long")
                    #Selections based on output
                    if ??????????????:
                        print ("This",data[i][3], "is small size")
                    elif ??????????????:
                        print ("This",data[i][3], "is medium size")
                    else:
                        print ("This",data[i][3], "is large size")                 
                        
def search():
        target = input("What species are you looking for? Enter name")     
        #iterate through array- i&j


                #selection if item= target
                i
                    #will print whole record
                    print(data[i])

def goodbye():
    print("Goodbye")
    #finish this code
    status=???
    

### Main Program
while status=="True":
    ??????


# data[].attributes.body
a) Use other programs
b) Use Page 8 and 9 of your booklet

# data[].attributes.headline
STEP 9b- Done? Screenshot me the code and output working an email it to me!

# data[].attributes.subject
STEP 9b- Done? Screenshot me the code and output working an email it to me!

# data[].attributes.body
Bernard works at the Aqautic Centre in Plymouth. He needs a way of holding all of his data such as location, date, species, name, length and weight and then search or output lenghts of species.

The requiremements are:

5 subprograms will control the flow of the program via menu options

The program will loop and display a menu choice (subprogram) until the user presses 4

Create functionality so that if the user:

Presses 1 it ask for the input of the speciies location, date found, type,name, length and weight

Presses 2 it ask for the input "length" and it will search for a length and if the length is:

<=2.0 it will display the words "This speciies is small" and then displays the whole records

>2.0 and less than 5.0 it will display the words "This speciies is medium" and then the displays the whole record

Anything else it will display "Large species" and then the displays the whole record

Presses 3- it will search for all records for a species

Presses 4- The program will exit and stop

A program has already been started
Do not add any functionality to it

# data[].attributes.body
dd

# data[].attributes.attachment_link.readable_text
##ARRAY #########################
resultsTable =[["Conservative Party", 138, 43.7],
               ["Labour Party", 101, 32.3],
               ["Liberal Democrat Party", 356, 11.6],
               ["Scottish National Party", 113, 3.9],
               ["Green Party", 853, 2.6]]
##SUBPROGRAM #########################
def :
##DISPLAY MENU OPTIONS #########################
    pri
    choice=input("Press 1 for Result- Add party   Press 2 for add a record   Press 3- Output All Records   PRess 4 for Change a percentage and Press 5 to exit")
##CHOICE 1 #########################
    if choice=="1":
        #ask for id e.,g. integer
        target =       
        #iterate through array- i&j
        
        
                #selection if item= id
                if (resultsTable[i][j] == target):
                    #will print whole record
                    
##CHOICE 2 #########################
    elif choice=="2":
        #get inputs
        party=input("Enter Party")
        votes=int(input("Enter votes"))
        percent=float(input("Enter %"))
        #put inputs together
        
        #append to array
        resultsTable.append...
        #output the whole array showing the new record too
        print(resultsTable)
##CHOICE 3 #########################
    elif choice=="3":
        
##CHOICE 4 #########################
    elif choice=="4":
        #display what you want
        print("Lets change a % result")
        #ask for the party id. Integer!
        target = int(input("What party are you looking for? Enter ID e.g. 138"))
        #ask for the new precentage. Float!
        percentnew=
        #iterate through array-i&j


               #now if result equals id
              if (resultsTable[i][j] == target):
                  #change location to new percentage
                
                  #output the new record only
                  print("The record found is",resultsTable[i])#will print whole record
##CHOICE 5 #########################
    elif choice=="5":
        print ("Now exiting")

##MAIN PROGRAM #########################
menu
    

# data[].attributes.body
Using the data in a 2D Array to the right create a program in Python that:

Displays a welcome

Create a subprogram for the menu choice

Offers a menu of choice and program the functionality which is:

1= Search for a result (search by Party code e.g 138 and will output the results- party, votes nationally and percentage)
2= Enter a new party results in (e.g Raving Looney Party and there data)
3= Outputs the whole 2D Array
4= Allows the percentages of a given party to be changed
5= Exits

*** TIP USE HELP ON PAGE

# data[].attributes.headline
STEP 8- CONFIDENCE 3- Copy This Code To Thonny & See What It Does (as you paste it you may lost format)

# data[].attributes.subject
STEP 8- CONFIDENCE 3- Copy This Code To Thonny & See What It Does (as you paste it you may lost format)

# data[].attributes.body
deliveries = [["BH17", "PO89","Mr Jarvis", "Oven Gloves"],["LL23", "RH23","Mr Sergeant", "4 x Wine Glasses"]]

pcode = input("Enter the first two letters of the postcode?")

target=pcode[:2]

for i in range(len(deliveries)):

for j in range(len(deliveries[i])):

if (deliveries[i][j][:2] == target):

print(deliveries[i])#will print whole record

# data[].attributes.headline
STEP 7- CONFIDENCE 2- Copy This Code To Thonny & See What It Does (as you paste it you may lost format)

# data[].attributes.subject
STEP 7- CONFIDENCE 2- Copy This Code To Thonny & See What It Does (as you paste it you may lost format)

# data[].attributes.body
members = [[2323,"Jackson",234.00], [66323,"Jarvis",134.00], [1423,"Maltmer",434.00]]

target = int(input("What member are you looking for? Enter ID"))

for i in range(len(members)):

for j in range(len(members[i])):

if (members[i][j] == target):

print(members[i])#will print whole record

print (members[i][1])#will print found record index 1

print (members[i][0:1])#will print found record index 0 and 1

# data[].attributes.headline
STEP 5- CONFIDENCE 1- Copy This Code To Thonny & See What It Does (as you paste it you may lost format)

# data[].attributes.subject
STEP 5- CONFIDENCE 1- Copy This Code To Thonny & See What It Does (as you paste it you may lost format)

# data[].attributes.body
sportsday = [[582, "Carter", "Joe", 12.1, 26.9],[675, "Lewis", "Levi", 6.86, 28.99]]

print ("Welcome to the sports day system")

compnum=int(input("Enter your competitior number number"))

lastName=input("Enter your last name")

firstName=input("Enter your first name")

shotPutt=float(input("Enter your shot putt length"))

twohundred=float(input("Enter your 200m time"))

newRecord = [compnum, lastName, firstName, shotPutt, twohundred]

sportsday.append (newRecord)

print ("The new records is: ", newRecord)

print ("All records now look like",sportsday)

# data[].attributes.attachment_link.readable_text

# -------------------------------------------------------------------
# Global variables
# -------------------------------------------------------------------
membersTable = [[1996, "Adams", "Amanda", 1, 1996],
                [2002, "Brown", "Brenda", 6, 2000],
                [2000, "Collins", "Christopher", 3, 1999],
                [2010, "Dawson", "Denise", 12, 2001],
                [2016, "Everett", "Edward", 8, 2012]]

##Q1. DISPLAY A WELCOME

###type here

### Q2. FIX THESE INPUTS AS SOME OF THE DATA TYPES AND CODE IS WRONG
idNum=int(input("Enter your ID number")
lastName=input("Enter your last name")
firstName=input(Enter your first name")
birthMonth=input("Enter your birth month")
birthYear=inputEnter your birth year ")

#Q3. Assign the new inputted fields above to the variable newRecord. Already started
newRecord = [idNum, ]


#Q4. Add the new record to the 2d array using the append feature
###type here

#Q5. Displaythe new record
###type here

#Q6 Display the whole array


# data[].attributes.body
1) Open the file to the right and download and then add to your GCSe Python file
2) Using your knowledge complete Q1 to 6 in the file

# data[].attributes.headline
Need help with the random number generator?

# data[].attributes.subject
Need help with the random number generator?

# data[].attributes.body
i) You need to import random
ii) Now add code similar to this:

num1 = random.randint(0,2)
num2 = random.randint(???)

print(animals[???][num2])

# data[].attributes.body
a) Use the worksheet to create a password manager. Complete all tasks

b) Go to R:\IT & Computing\!Year 10 Computer Science\Python Programming\2D Arrays

c) ** Do not use your real accounts and passwords for this activity.

# data[].attributes.body
a) You will use the "Word Play" worksheet to practise navigating a 2D list.
b) Open the location: R:\IT & Computing\!Year 10 Computer Science\Python Programming\2D Arrays
c) DONE? Do the Explorers Task
d) Show me