rpa게시판 글답변
본문 바로가기
메뉴열기
메뉴 닫기
아주방열린공장(홈)
나만의지도만들기W
가상쉬은라벨지만들기
텍스트QR
FAQ
1:1문의
접속자
4
새글
사용자메뉴
메뉴 닫기
사이트 내 전체검색
검색
뒤로가기
rpa게시판 글답변
rpa게시판 글답변
이름
필수
비밀번호
필수
이메일
홈페이지
옵션
html
제목
필수
내용
필수
웹에디터 시작
> > > print("{0: >10}".format(500)) > print("{0: >+10}".format(500)) > print("{0: >+10}".format(-500)) > > print("{0:_<+10}".format(500)) > > print("{0:,}".format(1000000000)) > print("{0:+,}".format(-1000000000)) > > print("{0:^<+30,}".format(-1000000000)) > > print("{0:f}".format(5/3)) > print("{0:.2f}".format(5/3)) > > > > # score_file = open("score.txt", "w", encoding="utf-8") > > # print("수학 : 0", file=score_file) > # print("영어 : 50", file=score_file) > > # score_file.close() > > # score_file = open("score.txt","a", encoding='utf-8') > # score_file.write("과학 : 80") > # score_file.write("\n코딩 : 100") > > # score_file.close() > > # score_file = open("score.txt","r", encoding='utf-8') > # print(score_file.read()); > # score_file.close() > > # score_file = open("score.txt","r", encoding='utf-8') > # print(score_file.readline(), end="") > # print(score_file.readline(), end="") > # score_file.close() > > # score_file = open("score.txt","r", encoding='utf-8') > # while True: > # line = score_file.readline() > # if not line : > # break > # print(line, end="") > # score_file.close() > > score_file = open("score.txt","r", encoding='utf-8') > lines = score_file.readlines() > for line in lines : > print(line, end="") > score_file.close() > > #피클 > import pickle > > profile_file = open("profile.pickle", "wb") > profile = {"이름":"박명수", "나이":30, "취미":["축구", "골프", "코딩"]} > print(profile) > pickle.dump(profile_file, profile) > profile_file.close() > > > profile_file = open("profile.pickle", "rb") > profile = pickle.load(profile_file) > print(profile) > profile_file.close() > > > > > #import pickle > > #with open("profile.pickle", "rb") as profile_file: > #print(pickle.load(profile_file)) > > > with open("study.txt", "w", encoding="utf8") as study_file: > study_file.write("파이썬을 열심히 공부하고 있어요.") > > > for i in range(1, 51): > with open(str(i) + "주차.txt", "w", encoding="utf-8") as report_file: > report_file.write("- {0} 주차 주간보고 -".format(i)) > report_file.write("\n부서 :") > report_file.write("\n이름 :") > report_file.write("\n업무 요약 :") > > > > > # 마린 : 공격 유닛, 군인. 총을 쏠 수 있습니다. > > name = "마린" > hp = 40 > damage = 5 > > > print("{} 유닛이 생성되었습니다.".format(name)) > print("체력 {0}, 공격력 {1}\n".format(hp, damage)) > > > # 탱크 : 공격 유닛, 탱크, 포를 쏠수 있음. 일반 모드/ 시즈 모드 > > tank_name = "탱크" > tank_hp = 150 > tank_damage = 35 > > print("{} 유닛이 생성되었습니다.".format(tank_name)) > print("체력 {0}, 공격력 {1}\n".format(hp, tank_damage)) > > def attack(name, location, damage): > print("{0} : {1} 방향으로 적국을 공격합니다. [공격력 {2}]".format(name, location, damage )) > > > attack(name, "1시", damage) > attack(tank_name, "1시", tank_damage) > > class Unit: > def __init__(self, name, hp, damage): > self.name = name > self.hp = hp > self.damage = damage > print("{0} 유닛이 생성 되었습니다.".format(self.name)) > print("체력 {0}, 공격력 {1}".format(self.hp, self.damage)) > > > > marine1 = Unit("마린", 40, 5) > marine2 = Unit("마린", 40, 5) > tank = Unit("탱크", 150, 35) > >
웹 에디터 끝
링크 #1
링크 #2
파일 #1
파일첨부
파일 #2
파일첨부
자동등록방지
자동등록방지
숫자음성듣기
새로고침
자동등록방지 숫자를 순서대로 입력하세요.
취소
작성완료
Copyright ©
open.ajubang.com/mm
All rights reserved.
상단으로