We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Day 16: Exceptions - String to Integer
Day 16: Exceptions - String to Integer
Sort by
recency
|
990 Discussions
|
Please Login in order to post a comment
Hi Can someone explain why this makes the test to fail (while the output is ok..) ? Thanks in advance
i dont know why my answer is wrong the output ic correct-#!/bin/python3
import sys
if name == 'main': S = input().strip() # Read input and strip leading/trailing whitespaces
Here's the ugly Typescript that doesn't use conditionals, lol.
I don't think you can actually complete this task using Typescript as the resulting number is just NaN and throwing your own error will fail becasue you have an if statement.