Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
Accelerator
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
Uh oh!
There was an error while loading.
Please reload this page
.
haedalprogramming
/
python_ebs
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Files
Expand file tree
master
Breadcrumbs
python_ebs
/
code
/
10-01-mini_quiz.py
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
63 lines (56 loc) · 1.72 KB
master
Breadcrumbs
python_ebs
/
code
/
10-01-mini_quiz.py
Copy path
Top
File metadata and controls
Code
Blame
63 lines (56 loc) · 1.72 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# 10차시 - 개념 복습
# 퀴즈 6개
# 퀴즈 1
# 리스트의 슬라이싱 복습
# nums리스트에 [1,2,3,4,5] 저장
nums=[1,2,3,4,5]
# nums리스트의 1번 항목부터 3번 항목까지(마지막 숫자는 포함안됨) 출력
print(nums[1:4])
# nums[1]=2, nums[3]=4 이므로 정답은 B)[2,3,4]
# 퀴즈 2
# for 반복문 range(시작, 끝, 간격)
# i변수를 1부터 6까지 2씩 증가시키면서 반복
for i in range(1, 6, 2):
# i 출력
print(i)
# 1 3 5이므로 정답은 B(1 3 5)
# 퀴즈 3
# 함수와 매개변수, 기본값
# test(a, b=10(기본값))정의하기
def test(a,b=10):
# a*b 반환하기
return a*b
# test(5) 출력하기
print(test(5))
# 인수값이 2개 전달되어야 하지만 1개만 전달됨. 하지만 b=10기본값이 있어서
# a=5, b=10, a*b=50으로 정답은 C)50
# 퀴즈 4
# 연산자 복습
# numbers에 [1,2,3,4,5]저장
numbers=[1,2,3,4,5]
# total 변수에 0저장
total=0
# numbers에 있는 값들을 하나씩 꺼내서 n에 넣고
for n in numbers:
# total에 total+n값 저장하기
total +=n
# total값 출력
print(total)
# 빈칸에 들어갈 연산자는 복합대입연산자 +=
# 퀴즈 5
# 리시트 복습
# fruits 리스트에 "사과","바나나" 저장.
fruits=["사과","바나나"]
# fruits 리스트에 "오렌지" 맨뒤에 추가
fruits.append("오렌지")
# fruits의 길이 출력
print(len(fruits))
# ["사과","바나나"]리스트에 "오렌지"를 추가했으므로 ["사과","바나나","오렌지"]
# 따라서 fruits 리스트의 길이는 3. 출력 결과도 3이다.
# 퀴즈 6
# 함수 복습
# greeting(name) 정의하기
def greeting(name): # :이 빠지면 SyntaxError가 발생
# "안녕, name" 출력
# greeting("철수") 호출
greeting("철수")
You can’t perform that action at this time.