Basics of python
Basics of python
PROGRAMMING
ASSIGNMENT
Coding Exercises
Exercise 1: Prime Numbers
Write a Python program that checks whether a given number is prime or not. A
prime number is a natural number greater than 1 that has no positive divisors other
than 1 and itself.
example:
input_text = "This is a sample text. This text will be used to demonstrate the word
counter."
Expected output:
'This': 2
'is': 1
'a': 1
'sample': 1
'text.': 1
Write a Python function called is_palindrome that takes a string as input and returns
True if the string is a palindrome, and False otherwise. A palindrome is a word,
phrase, number, or other sequence of characters that reads the same forward and
Example:
Input: "racecar"
Please complete the coding exercises and answer the theoretical questions. Submit
your work in a single Python (.ipynb) file for the coding exercises.Ensure your code is
well-commented to explain your logic and approach. Good luck!