Zadanie domowe z 3. 4. i 5. lekcji

This commit is contained in:
Franciszek Wiatr 2024-12-02 14:47:30 +01:00
parent 27ad974e94
commit 0c1e2f6460
5 changed files with 157 additions and 0 deletions

BIN
dom3/Zadanie domowe.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

140
dom4/zad1.py Normal file
View File

@ -0,0 +1,140 @@
import base64
def encode_to_morse(input_str):
morseCode = ""
input = input_str.upper()
for c in input:
#10
if c == 'A':
morseCode += ".-"
if c == 'B':
morseCode += "-..."
if c == 'C':
morseCode += "-.-."
if c == 'D':
morseCode += "-.."
if c == 'E':
morseCode += "."
if c == 'F':
morseCode += "..-."
if c == 'G':
morseCode += "--."
if c == 'H':
morseCode += "...."
if c == 'I':
morseCode += ".."
if c == 'J':
morseCode += ".---"
#20
if c == 'K':
morseCode += "-.-"
if c == 'L':
morseCode += ".-.."
if c == 'M':
morseCode += "--"
if c == 'N':
morseCode += "-."
if c == 'O':
morseCode += "---"
if c == 'P':
morseCode += ".--."
if c == 'Q':
morseCode += "--.-"
if c == 'R':
morseCode += ".-."
if c == 'S':
morseCode += "..."
if c == 'T':
morseCode += "-"
#30
if c == 'U':
morseCode += "..-"
if c == 'V':
morseCode += "...-"
if c == 'W':
morseCode += ".--"
if c == 'X':
morseCode += "-..-"
if c == 'Y':
morseCode += "-.--"
if c == 'Z':
morseCode += "--.."
if c == 'Ą':
morseCode += ".-.-"
if c == 'Ć':
morseCode += ".-..."
if c == 'Ę':
morseCode += "..-.."
if c == 'Ł':
morseCode += ".-..-"
#40
if c == 'Ń':
morseCode += "--.--"
if c == 'Ó':
morseCode += "---."
if c == 'Ś':
morseCode += "...-..."
if c == 'Ź':
morseCode += "--..-."
if c == 'Ż':
morseCode += "--..-"
if c == '1':
morseCode += ".----"
if c == '2':
morseCode += "..---"
if c == '3':
morseCode += "...--"
if c == '4':
morseCode += "....-"
if c == '5':
morseCode += "....."
#50
if c == '6':
morseCode += "-...."
if c == '7':
morseCode += "--..."
if c == '8':
morseCode += "---.."
if c == '9':
morseCode += "----."
if c == '0':
morseCode += "-----"
if c == '.':
morseCode += ".-.-.-"
if c == ',':
morseCode += "--..--"
if c == '\'':
morseCode += ".----."
if c == '"':
morseCode += ".-..-."
#if c == '+':
# morseCode += "..--.-"
#60
if c == ':':
morseCode += "---..."
if c == ';':
morseCode += "-.-.-."
if c == '?':
morseCode += "..--.."
if c == '!':
morseCode += "-.-.--"
if c == '-':
morseCode += "-....-"
if c == '+':
morseCode += ".-.-."
if c == '/':
morseCode += "-..-."
if c == '(':
morseCode += "-.--."
if c == ')':
morseCode += "-.--.-"
if c == '=':
morseCode += "-...-"
# FOR SPACES
if c == ' ':
morseCode += " /"
morseCode += ' '
return morseCode
text = input("Enter your value: ")
encoded_text = encode_to_morse(text)
print(f"Tekst '{text}' zakodowany na morse'a: {encoded_text}")

12
dom4/zad2.txt Normal file
View File

@ -0,0 +1,12 @@
Czerwony = 0%, 100%, 100%, 0%
Zielony = 100%, 0%, 100%, 0%
Żółty = 0%, 0%, 100%, 0%
Turkusowy = 71%, 0%, 7%, 12%
Seledynowy = 24%, 0%, 22%, 12%
Burgund = 0%, 98%, 99%, 62%
Ecru = 0%, 0%, 10%, 4%
Beżowy = 0%, 14%, 35%, 15%
Akwamaryn = 50%, 0%, 17%, 0%
Granatowy = 100%, 100%, 0%, 50%
Szkarłatny = 0%, 90%, 90%, 32%
Pudrowy róż = 0%, 25%, 20%, 0%

5
dom5/zadanie 1 i 2.txt Normal file
View File

@ -0,0 +1,5 @@
File Size:
- .bmp 2,75MB 2 880 054B *oryginalny plik*
- .png 1,17MB 1 231 339B Kompresja: ~42,75%
- .jpg 704KB 721 124B Kompresja: ~25,04%
- .gif 460KB 471 449B Kompresja: ~16,37%

BIN
dom5/zadanie 3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB