Py Ass9
Py Ass9
1. Write a program that takes a string input from the user and checks if the string is a valid
hexadecimal number. A valid hexadecimal number can include digits (0-9) and letters (a-f, A-F).
Print "Valid hexadecimal" if it is, and "Invalid hexadecimal" if it isn't.
2. Write a program that takes three integer inputs from the user and checks if they can form a
valid triangle. Print "Valid triangle" if the sum of any two sides is greater than the third side, and
"Invalid triangle" otherwise.
3. Write a program that takes a user's input and checks if it is a valid email address. A valid email
address should contain exactly one "@" symbol and at least one "." symbol after the "@" symbol.
Print "Valid email" if it is, and "Invalid email" if it isn’t.
4. Write a program that takes four integer inputs from the user and checks if they can form a valid
rectangle. Print "Valid rectangle" if both pairs of opposite sides are equal, and "Invalid rectangle"
otherwise.
5. Write a program that takes a list of integers as input and checks if the list is sorted in ascending
order. Print "Sorted" if it is, and "Not sorted" if it isn't.
6. Write a program that takes a user's age as input and prints their age group. Age groups are as
follows: