Lab#10 Prime number and palindrome

active 11 years, 4 months ago
Lab#10  Prime number and palindrome
This Project is OPEN.
School / Office
Technology & Design
Project Description

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.

Acknowledgements

This project was created by: Anne Menmou

Recent Discussions

Sorry, there were no discussion topics found.

Recent Docs

prime number program code

# 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

palindrome 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