Skip to content

Instantly share code, notes, and snippets.

@sojohnnysaid
Created November 3, 2019 12:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sojohnnysaid/89dad8215fa498a31f297d0cf5d9acd5 to your computer and use it in GitHub Desktop.
Save sojohnnysaid/89dad8215fa498a31f297d0cf5d9acd5 to your computer and use it in GitHub Desktop.
python compare two strings
#compare two strings from user input
from cs50 import get_string
import sys
def main():
stringOne = get_string("enter string one: ")
stringTwo = get_string("enter string two: ")
if stringOne != stringTwo:
print("They are NOT the same!")
sys.exit(0)
print("They are the same")
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment