Skip to content

Commit

Permalink
Add Lecture of Friday, November 10
Browse files Browse the repository at this point in the history
  • Loading branch information
squillero committed Nov 10, 2023
1 parent 7c42245 commit 8620ff6
Show file tree
Hide file tree
Showing 5 changed files with 170 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Python/src/2023-24/20231110 2-dim arrays.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright © 2023 Giovanni Squillero <[email protected]>
# https://github.com/squillero/computer-sciences
# Free for personal or classroom use; see 'LICENSE.md' for details.

from pprint import pprint

ROWS = 5
COLUMNS = 10

# create a list of size COLUMNS
# row = [None] * COLUMNS
# pprint(row)

# Safe create an 2-dim array ROWS x COLUMNS
data = list()
for r in range(ROWS):
data.append([0] * COLUMNS)
data[1][2] = 1
data[2][1] = 3
pprint(data)
31 changes: 31 additions & 0 deletions Python/src/2023-24/20231110 dictionaries.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright © 2023 Giovanni Squillero <[email protected]>
# https://github.com/squillero/computer-sciences
# Free for personal or classroom use; see 'LICENSE.md' for details.

from pprint import pprint

data = dict()
data["giovanni"] = [23, 10]
data["furkan"] = [16, 9]
data["paola"] = [18, 5]
data["giovanni"] = [7, 7]
data["luca"] = [7, 1]
data["alvi"] = [12, 10]
data["iris"] = [12, 10]
data["muhammadmahdi"] = [21, 8]

pprint(data)
print()
pprint(list(data.keys()))
pprint(list(data))
print()
pprint(list(data.values()))
print()
pprint(list(data.items()))
print()
del data['giovanni']
pprint(list(data.items()))
print()
print()
for key, value in data.items():
print(f"data[{key!r}] => {value!r}")
16 changes: 16 additions & 0 deletions Python/src/2023-24/20231110 file.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright © 2023 Giovanni Squillero <[email protected]>
# https://github.com/squillero/computer-sciences
# Free for personal or classroom use; see 'LICENSE.md' for details.

from pprint import pprint

with open("20231110 loving.txt") as song:
for line in song.readlines():
line = line.rstrip()
print(line)

with open("20231110 loving.txt") as song:
lyrics_line_by_line = list(song.readlines())

with open("20231110 loving.txt") as song:
raw_lyrics = song.read()
79 changes: 79 additions & 0 deletions Python/src/2023-24/20231110 loving.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
[Intro]
Mmm, yeah, ha
Do, do, do, do, do, do, do, do, do
Do, do, do, do, do, do, do
Do, do, do, do, do, do, do, do, do
Do, do, do, do, do, do, do

[Verse 1: Paul Stanley]
Tonight, I wanna give it all to you
In the darkness, there's so much I wanna do
And tonight, I wanna lay it at your feet
'Cause, girl, I was made for you
And, girl, you were made for me

[Chorus]
I was made for lovin' you, baby
You were made for lovin' me
And I can't get enough of you, baby
Can you get enough of me?

[Verse 2: Paul Stanley]
Tonight, I wanna see it in your eyes
Feel the magic, there's something that drives me wild
And tonight, we're gonna make it all come true
'Cause, girl, you were made for me
And, girl, I was made for you
You might also like
Say Don’t Go (Taylor’s Version) [From The Vault]
Taylor Swift
Is It Over Now? (Taylor’s Version) [From The Vault]
Taylor Swift
Now and Then
The Beatles
[Chorus]
I was made for lovin' you, baby
You were made for lovin' me
And I can't get enough of you, baby
Can you get enough of me?
I was made for lovin' you, baby
You were made for lovin' me
And I can give it all to you, baby
Can you give it all to me?

[Bridge: Paul Stanley]
Oh, can't get enough, oh, oh
I can't get enough, oh, oh
I can't get enough
Yeah, ha

[Guitar Solo]

[Bridge]
Do, do, do, do, do, do, do, do, do
Do, do, do, do, do, do, do
Do, do, do, do, do, do, do, do, do
Do, do, do, do, do, do, do

[Chorus]
I was made for lovin' you, baby
You were made for lovin' me
And I can't get enough of you, baby
Can you get enough of me?

[Bridge]
Oh, I was made
You were made
I can't get enough
No, I can't get enough

[Chorus]
I was made for lovin' you, baby
You were made for lovin' me
And I can't get enough of you, baby
Can you get enough of me?

[Outro]
I was made for lovin' you, baby
You were made for lovin' me
And I can't get
24 changes: 24 additions & 0 deletions Python/src/2023-24/20231110 sets.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright © 2023 Giovanni Squillero <[email protected]>
# https://github.com/squillero/computer-sciences
# Free for personal or classroom use; see 'LICENSE.md' for details.

from pprint import pprint

data = set()
data.add("giovanni")
data.add("furkan")
data.add("paola")
data.add("giovanni")
data.add("luca")
data.add("alvi")
data.add("iris")
data.add("muhammadmahdi")

pprint(data)
print()
data = data - {'giovanni'}
pprint(data)
print()
data = data - {'giovanni'}
pprint(data)
print()

0 comments on commit 8620ff6

Please sign in to comment.