Exemple #1
0
# class 활용 예제
from notebook import NoteBook
from notebook import Note

new_note = Note()
new_note.write_content("Don't cry. because I'm happy")

quote_book = NoteBook("The Quote Book")
quote_book.add_note(new_note)
quote_book.add_note(new_note)
quote_book.add_note(new_note)
quote_book.add_note(new_note)
quote_book.add_note(new_note)

print(quote_book.get_number_of_pages())

# quote_book.add_note(Note("Hellow, world"))
# quote_book.add_note(Note("Hellow, world"))
# quote_book.add_note(Note("Hellow, world"))

# print(quote_book.get_number_of_pages())

my_note = quote_book.remove_note(10)
print(my_note)
# my_note = quote_book.remove_note(1)
# print(my_note)
Exemple #2
0
from notebook import NoteBook
from notebook import Note

quote_book = NoteBook("The Quote Book")

new_note = Note()
new_note.write_content(
    "Don't cry because it's over smile because it happened. -Dr.Seuss")

quote_book.add_note(new_note)

print(quote_book.get_number_of_pages())

quote_book.add_note(Note("Hello, World1"))
quote_book.add_note(Note("Hello, World2"))
quote_book.add_note(Note("Hello, World3"))
quote_book.add_note(Note("Hello, World4"))
quote_book.add_note(Note("Hello, World5"))

print(quote_book.get_number_of_pages())

my_note = quote_book.remove_note(1)
print(my_note)

print(quote_book.get_number_of_pages())
Exemple #3
0
note_3 = Note(good_sentence)

good_sentence = """행복의 문이 하나 닫히면 다른 문이 열린다. 그러나 우리는 종종 닫힌 문을 멍하니 바라보다가 우리를 향해 열린 문을 보지 못하게 된다. - 헬렌 켈러"""
note_4 = Note(good_sentence)

wise_saying_notebook = NoteBook("명언 노트")
wise_saying_notebook.add_note(note_1)
print(wise_saying_notebook.get_number_of_all_pages())

wise_saying_notebook.add_note(note_2)
print(wise_saying_notebook.get_number_of_all_pages())

wise_saying_notebook.add_note(note_3)
wise_saying_notebook.add_note(note_4)
print(wise_saying_notebook.get_number_of_all_pages())
print(wise_saying_notebook.get_number_of_all_characters())

wise_saying_notebook.remove_note(3)
print(wise_saying_notebook.get_number_of_all_pages())

wise_saying_notebook.add_note(note_1, 100)
wise_saying_notebook.add_note(note_1, 100)

for i in range(300):
    wise_saying_notebook.add_note(note_1, i)

print(wise_saying_notebook.get_number_of_all_pages())

wise_saying_notebook.add_note(note_1)
wise_saying_notebook.add_note(note_1)