Dr. Love asked you to create a program to help them come up with a compatibility score for their clients. But, of course, as we all know: these numbers are totally random. Luckily, Python can help us generate these random compatibility percentages using the `random` module!
Your task is to write a short program that asks for two names and outputs the percentage compatibility. The percentage should be a random integer between `0` and `100`. Dr. Love asked you to call this program `compatibility.py`.
-!- CODE language-text -!-Enter first name: Marge Simpson
Enter second name: Homer Simpson
Marge Simpson and Homer Simpson are 83% compatible.
-!- CODE language-text -!-Enter first name: Bob
Enter second name: Alice
Bob and Alice are 7% compatible.
CodeGrade is your virtual teaching assistant in your Python classroom. You teach, CodeGrade takes care of the rest.
Our 35 built-in fully automatically graded Introduction to Programming assignments are designed especially for middle school and high school coding education, in close collaboration with Harvard-Westlake School (Los Angeles, CA). You can start teaching Python at your school with confidence now. Or, easily scale your classroom with CodeGrade's tools.
Book a personal 30-minute demo now and we'll show you how to get started with CodeGrade in less than 1 hour!