add tasks 31-39
4
31 Error Handling/exercise-2.py
Normal file
@ -0,0 +1,4 @@
|
||||
number = 1
|
||||
while number < 13:
|
||||
print("[{0} squared = {1}".format(number, number * number))
|
||||
number += 1
|
||||
15
31 Error Handling/exercise-3.py
Normal file
@ -0,0 +1,15 @@
|
||||
def writeFile():
|
||||
"""write data to a file"""
|
||||
try:
|
||||
myFile = open('new_file.txt', 'w')
|
||||
myFile.write("Little Bo Peep has lost her sheep")
|
||||
myFile.write("\n")
|
||||
myFile.write("And doesn't know where to find them.")
|
||||
myFile.write("\n")
|
||||
myFile.close()
|
||||
except FileNotFoundError:
|
||||
print("Error: The file could not be created.")
|
||||
except IOError:
|
||||
print("Error: There was an issue writing to the file.")
|
||||
finally:
|
||||
print("File operation completed.")
|
||||
BIN
31 Error Handling/task.png
Normal file
|
After Width: | Height: | Size: 141 KiB |
BIN
32 Databases/task.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
33 Primary Keys/task.png
Normal file
|
After Width: | Height: | Size: 54 KiB |
BIN
34 Data Types/task.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
35 QBE Grids/task.png
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
36 Database Questions/task.png
Normal file
|
After Width: | Height: | Size: 176 KiB |
BIN
37 Comparison Operators/task.png
Normal file
|
After Width: | Height: | Size: 72 KiB |
BIN
38 Database Queries/task-2.png
Normal file
|
After Width: | Height: | Size: 222 KiB |
BIN
38 Database Queries/task.png
Normal file
|
After Width: | Height: | Size: 287 KiB |
BIN
39 Multiple table search/task.png
Normal file
|
After Width: | Height: | Size: 29 KiB |