본문 바로가기
728x90

분류 전체보기324

[LaTex] 테이블 만들기 3 - 색상 넣기 (Update: 2024-03-21) LaTeX에서 테이블에 색상을 넣는 방법에 대해서 알아보도록 하자. 컨텐츠는 아래와 같다. 0. 색상을 정의하는 방법 0.1. 색상과 관련된 패지키: color, colortbl (a) `color` 패키지 - `color` 패키지는 색상을 LaTeX으로 불러오는 역활을 하며, 기본적으로 driver-independent commands를 제공한다. - 기본적으로 color 패키지를 통해서 제공하는 색상은 다음 8가지이다; `red`, `white`, `blue`, `cyan`, `magneta`, `yellow`, `gray`, `green` - 기본적으로 제공하는 색상 이외의 색상을 제작하기 위해선, `rgb`를 통해서 만들면 된다. (아래 참고) (b) 테이블과.. 2024. 2. 29.
[Physics] Srednichi QFT Chapter 2 - solution 2024. 2. 18.
[Physics] Ashcroft & Mermin chapter 23 2024. 2. 18.
[Physics] Ashcroft & Mermin chapter 22 2024. 2. 18.
[CheckIO][Scientific Expedition] Latest-iso-datetime 1. Problem: https://py.checkio.org/en/mission/latest-iso-datetime/ 2. My solution import datetime def get_latest(dt1str: str, dt2str: str) -> str: time_comparison = [] # your code here for date in [dt1str, dt2str]: dummy_data = date.split('-') dummy_data[0] = str(int(date.split('-')[0])+3000) convert_to_unix_time = datetime.datetime.strptime("-".join(dummy_data), "%Y-%m-%dT%H:%M:%S").timestamp().. 2024. 2. 18.
[CheckIO/Scientific Expedition] Longest substring of unique characters 1. Problem : https://py.checkio.org/en/mission/longest-substring-of-unique-characters/ 2. My solution def longest_substr(s: str) -> int: # your code here no_repeat_list = [] longest = 0 for char in [*s]: if no_repeat_list.count(char) == 0: no_repeat_list.append(char) else: index = no_repeat_list.index(char)+1 no_repeat_list.append(char) no_repeat_list = no_repeat_list[index:] if len(no_repeat_li.. 2024. 2. 18.
[CheckIO] Replace All Occureences 1. Problem: https://py.checkio.org/en/mission/replace-all-occurrences/ 2. My solutions def replace_all(mainText: str, target: str, repl: str) -> str: # your code here return mainText.replace(target, repl) 2024. 2. 18.
[CheckIO] Convert To Title case 1. Problem: https://py.checkio.org/en/mission/convert-to-title-case/ 2. My solutions def to_title_case(sentence: str) -> str: # your code here return ' '.join([data.capitalize() for data in sentence.lower().split()]) print("Example:") print(to_title_case("hello world")) # These "asserts" are used for self-checking assert to_title_case("hello world") == "Hello World" assert to_title_case("openai .. 2024. 2. 18.
[CheckIO] Count Vowels 1. Problem: https://py.checkio.org/en/mission/count-vowels/ 2. My solutions def count_vowels(text: str) -> int: # your code here number_vowels = 0 lower_case = text.lower() for vowel in ['a','e','o','i', 'u']: number_vowels += [*lower_case].count(vowel) print(number_vowels) return number_vowels print("Example:") #print(count_vowels("Hello")) # These "asserts" are used for self-checking assert co.. 2024. 2. 18.
728x90