Lab#10 Prime number and palindrome
- OpenOpen
The project have 2 parts.
The first one is a program to test if an integer entered by the user is a prime number
The second is a program to test if a word (string) entered by the user is a palindrome.
Recent Discussions
Sorry, there were no discussion topics found.
Recent Docs
# check weather a number is prime or not # A prime number is a number that have only two divider: 1 and itself. p=int(input("Enter an integer: ")) if p in [0, 1, 4, 6]: print(p, "is not a prime number!") elif p in [2, 3, 5]: print(p, "is a See Moreprime number program code
# program to test if a word is a palindrome # the palindrome is a word that is equal to his mirror # function that takes a string as an argument and store the miror in a variable def mirror(word): lengh=len(word) result="" while See Morepalindrome program code