Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bedroombuilds/python2rust
/ double_first
Function
double_first
0a_error_handling/python/boilerplate.py:1–9 ·
view source on GitHub ↗
(vec)
Source
from the content-addressed store, hash-verified
1
def
double_first(vec):
2
try
:
3
first = vec[0]
4
parsed = int(first)
5
return
parsed * 2
6
except
IndexError:
7
print(
"no first item"
)
8
except
ValueError:
9
print(
"invalid first item"
)
10
11
12
if
__name__ ==
'__main__'
:
Callers
1
boilerplate.py
File · 0.70
Calls
1
print
Function · 0.50
Tested by
no test coverage detected