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

File Work For PA-1

Uploaded by

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

File Work For PA-1

Uploaded by

Arnab Dhar 8B
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Section A: If-Else Programs

1. Write a Python program that takes three integers as input from the user and prints
them in ascending order without using any built-in sorting functions or methods.
2. Create a program that prompts the user to enter the lengths of three sides of a triangle.
Based on these lengths, determine and print whether the triangle is equilateral,
isosceles, or scalene.
3. Write a program that simulates a simple ATM machine. It should ask the user for their
current balance and the amount they wish to withdraw. If the balance is sufficient,
deduct the amount and print the new balance. If the balance is insufficient, print a
message indicating so.
4. Create a program that simulates a simple online shopping experience. Prompt the user
to enter the total amount of their purchase and their membership status (premium or
regular). Apply different discount rates based on the total purchase amount and
membership status, and print the final amount payable

Section B: For Loop Programs


1. Write a Python program that prints all the even numbers from 1 to 50 using a for loop.
Additionally, calculate and print the product of all even numbers.
2. Create a program that calculates the factorial of a number entered by the user using a
for loop. Handle cases where the input is negative or not an integer. Additionally, print
the factorial calculation steps.
3. Write a program that takes a string input from the user and counts the number of
vowels (a, e, i, o, u) in the string using a for loop. Additionally, count and print the
number of consonants and the percentage of vowels in the string.
4. Develop a Python program that generates the Fibonacci sequence up to the nth term,
where n is entered by the user. Handle cases where the input is negative or not an
integer. Additionally, print the ratio of consecutive Fibonacci numbers.
Section C: List Based Programs
1. Write a Python program that takes two lists of integers as input from the user and
returns a new list containing only the common elements between the two lists, without
duplicates.
2. Develop a Python program that takes a list of numbers as input from the user and
prints all the numbers that are divisible by 3.
3. Write a program that takes a list of integers as input from the user and returns a new
list containing only the elements that are odd numbers.
Example:
Enter a list of integers: [5,25,6,8,9,81]
Output : [5,25,9,81]

Project Work

1. Perform the machine morality test using following link and upload the screenshot
of the final result.
http://moralmachine.mit.edu

2. Using the website https://artsexperiments.withgoogle.com/impactfilter/ answer the


following questions.
i. How much rise in temperature from current temperature will disappear 38%
of mangroves species?
ii. If the temperature rises by 4 degree centigrade from the current temperature
then what percentage of zooplankton species will disappear?
iii. Why 84% of Adelie penguin species will disappear if temperature rises by
4.6 degree centigrade from the current temperature?
iv. Why 100% of Turtles species will disappear when temperatures rises by 2.8
degree centigrade from the current temperature?
v. How many butterfly species in UK have suffered population decline in the
last 4 decades?
vi. Why Lions are currently listed as “vulnerable” on the IUCN Red List of
Threatened Species?
vii. How much rise in temperature from current temperature will disappear 32%
Polar Bear species?
viii. How many years will it take to decompose electronic waste?

You might also like