에러모음집
-
[파이썬 기본편] 4-3.문자열처리함수 Java에러에러모음집 2022. 7. 10. 10:07
python = "Python is Amazing" index = python.index("n") index = python.index("n") print(index) index = python.index("n", index + 1) print(index) find = python.find("n") # 처음으로 발견된 n의 인덱스 print(find) # 5 python의 n find = python.find("n", find + 1) print(find) print(python.index("Java")) print(python.find("Java")) print(python.count("n")) C:\Users\samsung\AppData\Local\Programs\Python\Python38\pyth..
-
[파이썬 기본편] 5-6.퀴즈 #4 3회차 도전 에러에러모음집 2022. 7. 8. 13:12
from random import * users=list(range(1,21)) shuffle(users) chicken_winner=sample(users,1) remain_users=set(users)-set(chicken_winner) coffee_winners=sample(remain_users,3) print("--당첨자 발표--") print("치킨 당첨자:{}".format(chicken_winnerc)) print("커피 당첨자:{}".format(coffee_winners)) print("축하합니다 ") set 자료구조연습겸 다시 공부해 보았다 since Python 3.9 and will be removed in a subsequent version. coffee_winners=samp..
-
2022-07-06 파이썬 100제 143 문자열 리스트에러모음집 2022. 7. 6. 15:31
리스트 = ["SK하이닉스", "삼성전자", "LG전자"] for i in 리스트: print(len(list_a)) Traceback (most recent call last): File "C:\Users\초록소프트\Desktop\회사업무공부\python100제\141~150.py", line 5, in print(len(list_a)) NameError: name 'list_a' is not defined. Did you mean: 'list'? Process finished with exit code 1 더보기 정답
-
에러 [파이썬 기본편] 3-5.퀴즈#2 (2회차 시도)에러모음집 2022. 7. 4. 21:23
from random import * users=randint(1,21) winner=shuffle(users) chicken_winner=sample(winner,1) coffee_winner=sample(winner,3) print("치킨당첨자:"+chicken_winner) print("커피당첨자:"+coffee_winner) Traceback (most recent call last): File "C:/Users/samsung/Desktop/HomeStudy_python_/[파이썬 기본편] 5-6.퀴즈 #4.py", line 4, in winner=shuffle(users) File "C:\Users\samsung\AppData\Local\Programs\Python\Python38\lib\ran..
-
에러 -파이썬 100 제_052 리스트에 원소 추가에러모음집 2022. 7. 4. 17:35
movie_rank=["닥터스트레인지","스플릿","럭키"] movie_rank.append("배트맨") print(movie_rank) movie_rank.add("슈퍼맨",1) ['닥터스트레인지', '스플릿', '럭키', '배트맨'] Traceback (most recent call last): line 4, in movie_rank.add("슈퍼맨",1) AttributeError: 'list' object has no attribute 'add' Process finished with exit code 1