0% found this document useful (0 votes)
3 views2 pages

Lab exercise - 4.docx

The document outlines six Python programming tasks. These tasks include evaluating mathematical expressions, performing operations on complex numbers, determining triangle validity and types, checking for Armstrong numbers, validating dates, and assessing password strength. Each task specifies the requirements and conditions to be implemented in the programs.

Uploaded by

hitikhatod
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)
3 views2 pages

Lab exercise - 4.docx

The document outlines six Python programming tasks. These tasks include evaluating mathematical expressions, performing operations on complex numbers, determining triangle validity and types, checking for Armstrong numbers, validating dates, and assessing password strength. Each task specifies the requirements and conditions to be implemented in the programs.

Uploaded by

hitikhatod
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
You are on page 1/ 2

1.

​Write a Python program that takes three numbers (a, b, c)


as input and evaluates the following expression:

2.​Write a Python program that:


a)​Accepts two complex numbers as input from the user.
b)​Performs addition, subtraction, multiplication, and
division on the complex numbers.
c)​Displays both the real and imaginary parts separately.

3.​Write a Python program that takes three sides of a


triangle (a, b, c) and determines:
a)​Whether a valid triangle can be formed (using the
triangle inequality theorem).
b)​Whether the triangle is Equilateral, Isosceles, or
Scalene based on its sides.

4.​Write a Python program that checks whether a given


N-digit number is an Armstrong number or not.
An Armstrong number (or narcissistic number) is a
number that is equal to the sum of its own digits, each
raised to the power of the number of digits.
5.​Write a Python program that:
a)​Takes three integer inputs day, month, year from the
user.
b)​Checks if the date is valid (e.g., February cannot have
30 days).
c)​Uses relational operators to ensure proper
day-month-year constraints.
d)​Considers leap years (divisible by 4 but not 100, except
divisible by 400).
6.​Write a Python program that:
a)​Accepts a password as input.
b)​Checks if the password is strong by meeting the
following conditions:
●​ At least 8 characters long
●​ Contains at least one uppercase letter
●​ Contains at least one lowercase letter
●​ Contains at least one digit (0-9)
●​ Contains at least one special character (@, #, $,
etc.)
c)​Uses relational and logical operators to verify all
conditions.

You might also like