What does this code mean: “assert result == repeat, (result, repeat)”? [duplicate]
This question already has answers here: What is the use of “assert” in Python? (23 answers) Closed 3 months ago. From here: from hypothesis import given, strategies as st @given(seq=st.one_of(st.binary(), st.binary().map(bytearray), st.lists(st.integers()))) def test_idempotent_timsort(seq): result = timsort(seq=seq) repeat = timsort(seq=result) assert result == repeat, (result, repeat) What does the last assert mean? I understand result […]
What does this code mean: “assert result == repeat, (result, repeat)”? [duplicate]
This question already has answers here: What is the use of “assert” in Python? (23 answers) Closed 3 months ago. From here: from hypothesis import given, strategies as st @given(seq=st.one_of(st.binary(), st.binary().map(bytearray), st.lists(st.integers()))) def test_idempotent_timsort(seq): result = timsort(seq=seq) repeat = timsort(seq=result) assert result == repeat, (result, repeat) What does the last assert mean? I understand result […]
What does this code mean: “assert result == repeat, (result, repeat)”? [duplicate]
This question already has answers here: What is the use of “assert” in Python? (23 answers) Closed 3 months ago. From here: from hypothesis import given, strategies as st @given(seq=st.one_of(st.binary(), st.binary().map(bytearray), st.lists(st.integers()))) def test_idempotent_timsort(seq): result = timsort(seq=seq) repeat = timsort(seq=result) assert result == repeat, (result, repeat) What does the last assert mean? I understand result […]
Problem requires an assertion to make sure given string does not have any numbers as part of it. Is there a way to do this without isalnum()?
This is the code I wrote so far. The rubric requires me to assert that the string input has alphabets, whitespaces and some special characters(!,@, etc.), but numbers are to raise an AssertionError. Is there any way to do this without isalnum() or isalpha() as either of them didn’t work.