0% found this document useful (0 votes)
27 views4 pages

Python Functions for Common Tasks

Uploaded by

shaikh2305081097
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views4 pages

Python Functions for Common Tasks

Uploaded by

shaikh2305081097
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Create a function is prime (n) that takes a number n and returns true if it’s a

prime number and False otherwise.

 Is _prime(11)# should return True

Write a function is palindrome ( word) that checks if a given word is a


palindrome .

 Palindrome (” racecar”) # should return True.


write a function fibonacci (n) that generates the first n number in the
fibonnacci sequence.

 Fibonacci(5)# should return [0,1,1,2,3,5,8,13]


Create a function check password strength (password) that checks the strength
of password based on the following criteria :

 At least 8 characters long .


 Contains both uppercase and lowercase letters.
 Contains at least one number.
 Contains at least one special character.
 return " strong" "Moderate " or "weak " based on the password s
strength.

You might also like