Python Programs
Python Programs
Date:
AIM: To write a Python Program to display all even numbers based on the user’s given
range.
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified successfully.
Exp- 2
Date:
AIM: To write a Python Program to check if a given number is an armstrong number.
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified successfully.
Exp- 3
Date:
AIM: To create a python program that accesses the value associated with a specific key in a
dictionary.
SOURCE CODE:
Exp- 4
Date:
AIM: To write a Python program that gives the factorial of a given number.
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified successfully.
Exp- 5
Date:
AIM: Creating a python program that provides the largest number in a given list.
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified successfully.
Exp- 6
Date:
AIM: Creating a python program that provides the number of palindromes in a given range
of numbers.
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified successfully.
Exp- 7
Date:
AIM: To write a Python Program to check if a given password is a good password.
SOURCE CODE:
Exp- 8
Date:
AIM: To write a Python Program to display all prime numbers based on the user’s given
range.
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified successfully.
Exp- 9
Date:
Result:
Thus, the above Python program has been executed and the output is verified successfully.
Exp- 10
Date:
AIM: To create a python program to check if a number is a palindrome and provides the
reverse of the number.
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified successfully.
Exp- 11
Date:
AIM: To write a Python Program to swap the keys and values in a given dictionary.
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified successfully.
Exp- 12
Date:
AIM: To write a python program that displays the maximum, minimum, average and the
sum of a given list.
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified successfully.
Exp- 13
Date:
Result:
Thus, the above Python program has been executed and the output
is verified successfully.
Exp- 14
Date:
AIM: To create a python program that checks if a given string is a palindrome or not.
SOURCE CODE:
Python Program Executed Output:
Result:
Thus, the above Python program has been executed and the output is verified successfully.
Exp- 15
Date:
AIM: To create a python program to sort a given tuple in ascending or descending order.
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified successfully.
Exp- 16
(Python-MySQL Connectivity)
Date:
AIM: To write a Python Program to integrate MYSQL with Python to create Database and
Table to store the details of employees.
SOURCE CODE:
SOURCE CODE:
Exp- 18
(Python-MySQL Connectivity)
Date:
AIM: To write a Python Program to integrate MYSQL with Python to search an Employee
using EMPID and update the Salary of an employee if present in already existing table EMP, if
not display the appropriate message.
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified successfully.
Exp- 19
(Python-MySQL Connectivity)
Date:
AIM: To create a python program to sort a given tuple in ascending or descending order.
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified successfully.