Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ci-cd-exercise
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
Cedric Verstege
ci-cd-exercise
Commits
4f42a2e4
Commit
4f42a2e4
authored
1 month ago
by
wep23441
Browse files
Options
Downloads
Patches
Plain Diff
tests pycov
parent
7ee16298
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
case-2-test/wizard_calculator.py
+2
-6
2 additions, 6 deletions
case-2-test/wizard_calculator.py
with
2 additions
and
6 deletions
case-2-test/wizard_calculator.py
+
2
−
6
View file @
4f42a2e4
...
...
@@ -22,8 +22,7 @@ def cast_division_spell(a, b):
def
conjure_magic_circle_area
(
radius
):
return
math
.
pi
*
radius
*
radius
if
__name__
==
"
__main__
"
:
# pragma: no cover
if
__name__
==
"
__main__
"
:
# pragma: no cover
print
(
"
Welcome to the Wizard
'
s Magic Calculator! 🧙♂️✨
"
)
print
(
"
Choose your spell:
"
)
print
(
"
1. Summon dragons 🐉
"
)
...
...
@@ -32,20 +31,17 @@ if __name__ == "__main__":
print
(
"
4. Cast division spell ✨
"
)
print
(
"
5. Conjure magic circle area 🔮
"
)
choice
=
2
#
input("Enter your choice (1/2/3/4/5): ")
choice
=
input
(
"
Enter your choice (1/2/3/4/5):
"
)
if
choice
==
"
5
"
:
# pragma: no cover
radius
=
float
(
input
(
"
Enter the radius of your magic circle:
"
))
result
=
conjure_magic_circle_area
(
radius
)
print
(
"
\n
✨ Magic complete! ✨
"
)
print
(
f
"
Circle area:
{
result
:
.
2
f
}
spells.
"
)
else
:
# pragma: no cover
a
=
float
(
input
(
"
Enter the first magical number:
"
))
b
=
float
(
input
(
"
Enter the second magical number:
"
))
# pragma: no cover
if
choice
==
"
1
"
:
result
=
summon_dragons
(
a
,
b
)
elif
choice
==
"
2
"
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment