Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
c4cs-w16-conflict1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pat Pannuto
c4cs-w16-conflict1
Merge requests
!1
The source project of this merge request has been removed.
Merge me
Closed
Merge me
(removed):merge_me
into
master
Overview
0
Commits
4
Pipelines
0
Changes
2
Closed
pjeschba
requested to merge
(removed):merge_me
into
master
8 years ago
Overview
0
Pipelines
0
Changes
-
Expand
Merge into master
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
545334d4
4 commits,
8 years ago
+
43
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
Search (e.g. *.vue) (Ctrl+P)
main.py
+
40
−
0
Options
@@ -3,5 +3,45 @@
def
print_welcome
():
print
(
"
Welcome to the simple test program
"
)
def
compute_time
(
current_month
):
# Winter months means no work can happen
WINTER
=
(
0
,
1
,
2
,
10
,
11
)
# Jan, Feb, Mar, .., Nov, Dec
# List of (todo, months)
TODO
=
(
(
'
Finish Molds
'
,
3
),
(
'
New Topsoil
'
,
2
),
(
'
New Sidewalks
'
,
2
),
(
'
Install WiFi
'
,
1
),
(
'
Plant Trees
'
,
2
),
)
months
=
0
for
todo
in
TODO
:
while
(
current_month
%
12
)
in
WINTER
:
months
+=
1
current_month
+=
1
months
+=
todo
[
1
]
current_month
+=
todo
[
1
]
return
months
def
pretty_print
(
current_month
,
current_year
,
months_to_go
):
def
month_to_season
(
month
):
if
month
in
(
11
,
0
,
1
):
return
'
Winter
'
if
month
in
(
2
,
3
,
4
):
return
'
Spring
'
if
month
in
(
5
,
6
,
7
):
return
'
Summer
'
if
month
in
(
8
,
9
,
10
):
return
'
Fall
'
raise
NotImplementedError
(
"
Illegal month
"
)
year
=
current_year
+
int
(
months_to_go
/
12
)
month
=
current_month
+
months_to_go
%
12
return
month_to_season
(
month
)
+
'
'
+
str
(
year
)
+
'
.
'
if
__name__
==
'
__main__
'
:
print_welcome
()
time
=
compute_time
(
2
)
# 2 is March
print
(
pretty_print
(
2
,
2016
,
time
))
Loading