Skip to main content
deleted 3 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282

Python 3,  51 44 43  41 bytes

-7 thanks to loopy walt's suggestion to use *open.
-1 thanks to xnor's suggestion to replace any(...) with 1in ...
-2 thanks to dingledooper's suggestion of using str.find instead of str.__eq__

0in map(str.find,*open(0))or print('yep')

Try it online!

This is a full program that takes input from STD INstdin until an EOF (which we assume the user provides at the end of the second line) with open(0) and maps across the two strings by splatting (*), calling str.find on each pair of characters in turn. If 0 is in the result (i.e. the characters are equal and so the index of the first in the second is 0 rather than -1 for "not found") then the right-hand clause of the or is not evaluated, and so we don't print.


My previous version, with xnor's and dingledooper's suggestions, at \$48\$, is interactive without the EOF faff:

0in map(str.find,input(),input())or print('yep')

You could save one more byte by printing to STD ERRstderr instead of STD OUTstdout by exiting the program early using exit in place of print.


A note to your son - this is not how I'd want someone in my team at work to write code :) - readability counts, a lot.

Python 3,  51 44 43  41 bytes

-7 thanks to loopy walt's suggestion to use *open.
-1 thanks to xnor's suggestion to replace any(...) with 1in ...
-2 thanks to dingledooper's suggestion of using str.find instead of str.__eq__

0in map(str.find,*open(0))or print('yep')

Try it online!

This is a full program that takes input from STD IN until an EOF (which we assume the user provides at the end of the second line) with open(0) and maps across the two strings by splatting (*), calling str.find on each pair of characters in turn. If 0 is in the result (i.e. the characters are equal and so the index of the first in the second is 0 rather than -1 for "not found") then the right-hand clause of the or is not evaluated, and so we don't print.


My previous version, with xnor's and dingledooper's suggestions, at \$48\$, is interactive without the EOF faff:

0in map(str.find,input(),input())or print('yep')

You could save one more byte by printing to STD ERR instead of STD OUT by exiting the program early using exit in place of print.


A note to your son - this is not how I'd want someone in my team at work to write code :) - readability counts, a lot.

Python 3,  51 44 43  41 bytes

-7 thanks to loopy walt's suggestion to use *open.
-1 thanks to xnor's suggestion to replace any(...) with 1in ...
-2 thanks to dingledooper's suggestion of using str.find instead of str.__eq__

0in map(str.find,*open(0))or print('yep')

Try it online!

This is a full program that takes input from stdin until an EOF (which we assume the user provides at the end of the second line) with open(0) and maps across the two strings by splatting (*), calling str.find on each pair of characters in turn. If 0 is in the result (i.e. the characters are equal and so the index of the first in the second is 0 rather than -1 for "not found") then the right-hand clause of the or is not evaluated, and so we don't print.


My previous version, with xnor's and dingledooper's suggestions, at \$48\$, is interactive without the EOF faff:

0in map(str.find,input(),input())or print('yep')

You could save one more byte by printing to stderr instead of stdout by exiting the program early using exit in place of print.


A note to your son - this is not how I'd want someone in my team at work to write code :) - readability counts, a lot.

added 357 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282

Python 3,  51 44 43  4341 bytes

-7 thanks to loopy walt'sloopy walt's suggestion to use *open.
-1 thanks to xnor'sxnor's suggestion to replace any(...) with 1in ...
-2 thanks to dingledooper's suggestion of using str.find instead of str.__eq__

1in0in map(str.__eq__find,*open(0))or print('yep')

Try it online!Try it online!

This is a full program that takes input from STD IN until an EOF (which we assume the user provides at the end of the second line) with open(0) and maps across the two strings by splatting (*), calling str.__eq__find on each pair of characters in turn. If 10 is in the result (Ni.Be. the characters are equal and so the index of the first in the second is True0 equates torather than -1 in Pythonfor "not found") then the right-hand clause of the or is not evaluated, and so we don't print.


My previous version, with xnor's suggestionand dingledooper's suggestions, at 50\$48\$, is interactive without the EOF faff:

1in0in map(str.__eq__find,input(),input())or print('yep')

You could save one more byte by printing to STD ERR instead of STD OUT by exiting the program early using exit in place of print.


A note to your son - this is not how I'd want someone in my team at work to write code :) - readability counts, a lot.

Python 3,  51 44  43 bytes

-7 thanks to loopy walt's suggestion to use *open.
-1 thanks to xnor's suggestion to replace any(...) with 1in ...

1in map(str.__eq__,*open(0))or print('yep')

Try it online!

This is a full program that takes input from STD IN until an EOF (which we assume the user provides at the end of the second line) with open(0) and maps across the two strings by splatting (*), calling str.__eq__ on each pair of characters in turn. If 1 is in the result (N.B. True equates to 1 in Python) then the right-hand clause of the or is not evaluated, and so we don't print.


My previous version, with xnor's suggestion, at 50, is interactive without the EOF faff:

1in map(str.__eq__,input(),input())or print('yep')

You could save one more byte by printing to STD ERR instead of STD OUT by exiting the program early using exit in place of print.


A note to your son - this is not how I'd want someone in my team at work to write code :) - readability counts, a lot.

Python 3,  51 44 43  41 bytes

-7 thanks to loopy walt's suggestion to use *open.
-1 thanks to xnor's suggestion to replace any(...) with 1in ...
-2 thanks to dingledooper's suggestion of using str.find instead of str.__eq__

0in map(str.find,*open(0))or print('yep')

Try it online!

This is a full program that takes input from STD IN until an EOF (which we assume the user provides at the end of the second line) with open(0) and maps across the two strings by splatting (*), calling str.find on each pair of characters in turn. If 0 is in the result (i.e. the characters are equal and so the index of the first in the second is 0 rather than -1 for "not found") then the right-hand clause of the or is not evaluated, and so we don't print.


My previous version, with xnor's and dingledooper's suggestions, at \$48\$, is interactive without the EOF faff:

0in map(str.find,input(),input())or print('yep')

You could save one more byte by printing to STD ERR instead of STD OUT by exiting the program early using exit in place of print.


A note to your son - this is not how I'd want someone in my team at work to write code :) - readability counts, a lot.

added 39 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282

Python 3,  51 44  43 bytes

-7 thanks to loopy walt's suggestion to use *open.
-1 thanks to xnor's suggestion to replace any(...) with 1in ...

1in map(str.__eq__,*open(0))or print('yep')

Try it online!

This is a full program that takes input from STD IN until an EOF (which we assume the user provides at the end of the second line) with open(0) and maps across the two strings by splatting (*), calling str.__eq__ on each pair of characters in turn. If 1 is in the result (N.B. True equates to 1 in Python) then the right-hand clause of the or is not evaluated, and so we don't print.


My previous version, with xnor's suggestion, at 50, is interactive without the EOF faff:

1in map(str.__eq__,input(),input())or print('yep')

You could save one more byte by printing to STD ERR instead of STD OUT by exiting the program early using exit in place of print.


A note to your son - this is not how I'd want someone in my team at work to write code :) - readability counts, a lot.

Python 3,  51 44  43 bytes

-7 thanks to loopy walt's suggestion to use *open.
-1 thanks to xnor's suggestion to replace any(...) with 1in ...

1in map(str.__eq__,*open(0))or print('yep')

Try it online!

This is a full program that takes input from STD IN until an EOF (which we assume the user provides at the end of the second line) with open(0) and maps across the two strings by splatting (*), calling str.__eq__ on each pair of characters in turn. If 1 is in the result then the right-hand clause of the or is not evaluated, and so we don't print.


My previous version, with xnor's suggestion, at 50, is interactive without the EOF faff:

1in map(str.__eq__,input(),input())or print('yep')

You could save one more byte by printing to STD ERR instead of STD OUT by exiting the program early using exit in place of print.


A note to your son - this is not how I'd want someone in my team at work to write code :) - readability counts, a lot.

Python 3,  51 44  43 bytes

-7 thanks to loopy walt's suggestion to use *open.
-1 thanks to xnor's suggestion to replace any(...) with 1in ...

1in map(str.__eq__,*open(0))or print('yep')

Try it online!

This is a full program that takes input from STD IN until an EOF (which we assume the user provides at the end of the second line) with open(0) and maps across the two strings by splatting (*), calling str.__eq__ on each pair of characters in turn. If 1 is in the result (N.B. True equates to 1 in Python) then the right-hand clause of the or is not evaluated, and so we don't print.


My previous version, with xnor's suggestion, at 50, is interactive without the EOF faff:

1in map(str.__eq__,input(),input())or print('yep')

You could save one more byte by printing to STD ERR instead of STD OUT by exiting the program early using exit in place of print.


A note to your son - this is not how I'd want someone in my team at work to write code :) - readability counts, a lot.

added 79 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282
Loading
added 79 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282
Loading
added 132 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282
Loading
deleted 2 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282
Loading
deleted 2 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282
Loading
added 76 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282
Loading
added 146 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282
Loading
added 10 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282
Loading
added 203 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282
Loading
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282
Loading