0% found this document useful (0 votes)
8 views15 pages

CS - Project File

The document outlines a series of programming tasks and concepts primarily focused on using loops in Python. It includes exercises for generating patterns, calculating sums, checking conditions, and manipulating data structures. Each task aims to enhance understanding of loops, nested loops, and basic programming logic.

Uploaded by

vishalrathor2109
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)
8 views15 pages

CS - Project File

The document outlines a series of programming tasks and concepts primarily focused on using loops in Python. It includes exercises for generating patterns, calculating sums, checking conditions, and manipulating data structures. Each task aims to enhance understanding of loops, nested loops, and basic programming logic.

Uploaded by

vishalrathor2109
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

Index – CS Project File

1. Predict the output of a nested for-loop program

2. Print pattern using nested loops:

0
01
012
0123

3. Print inverted star pattern using nested loops

4. Calculate and print sum of numbers from 0 to 10

5. Discount based on order value (>500 → 20%, else 5%)

6. Print Grade (A for 90–100, B for 80–89)

7. Loan eligibility check based on age, income, and loan status

8. Identify type of triangle (Equilateral, Isosceles, Scalene)

9. Calculate and print BMI from weight (kg) and height (feet)

10. Print numbers up to end number with given step

11. Multiplication table of a given number (1–10)

12. Calculate factorial (permutation) of a number

13. Print each character of a word on a new line

14. Count alphabets and digits in a string


15. Create a list, update value at given position, and print

16. Nested loop multiplication (1–3 × 2–4) with break >10

17. Print decreasing number pattern (rows 6 → 2)

18. Print diamond star pattern (4 rows up, 3 rows down)

19. Find minimum and maximum among five input numbers

20. Concept Q: Loops and spacing for symmetrical pattern

21. Concept Q: Nested loops for controlling rows and ranges

22. Concept Q: Using break statement when product > 10

23. Concept Q: Checking element existence before adding to list

24. Concept Q: Using loop + append to store (number, cube) pairs

25. Concept Q: Using modulo operator for even/odd check


Q : # Question: What will be the output of the following program?
# The program uses nested for loops to print numbers in a specific pattern.
# Analyze the code and predict the output.

Q : Write a Python program that prints the following pattern using nested loops:
0
01
012
0123
Q : Write a Python program that prints the following pattern using nested loops:

******
*****
****
***
**
*

Q:Write a Python program to calculate and print the sum of all numbers from 0 to 10 using a
[Link] output should display the final sum.
Q:Write a Python program to ask the user for the order value.​
If the order value is over 500 rupees, print "discount of 20%"; otherwise, print "discount of 5%".

Q : Print "Grade : A" if marks are between 90 and 100, and "Grade : B" if marks are between 80
and 89.
Q : Write a Python program to check a person's loan eligibility based on their age, annual
income, and existing loan status.​
If age is over 21 and annual income is above 30,000, calculate the eligible loan amount (3
times the annual income, halved if there’s an existing loan), otherwise print the appropriate
message.

Q : Write a Python program to accept the lengths of three sides of a triangle from the user.​
Print whether the triangle is Equilateral, Isosceles, or Scalene based on the given sides.
Q :Write a Python program to calculate and print the BMI (Body Mass Index) of a person.​
Ask the user to input their weight in kilograms and height in feet, then display the BMI value.

Q :Write a Python program to take an end number and a step number as input from the user.​
Print all numbers starting from 1 up to (but not including) the end number, incrementing by the
given step.
Q :Write a Python program to take a number as input from the user.​
Print the multiplication table for that number from 1 to 10.

Q :Write a Python program to take a number as input from the user and calculate its
permutation (factorial).​
Print the result showing the permutation of the entered number.
Q :Write a Python program to take a word as input from the user.​
Print each character of the word on a separate line using a loop.

Q :Write a Python program to take a string as input from the user.


Count and print the number of alphabetic characters and the number of digits in the entered
string.

Q :Write a Python program to create a list by taking input values from the user.
Then, ask the user for a position and a new value, update the value at that position in the list,
and print the updated list.

Q:Write a Python program using nested loops to multiply numbers from 1 to 3 with numbers
from 2 to 4.
If the product is greater than 10, break the inner loop; otherwise, print the product.
Q :Write a Python program using nested loops to print the following pattern:​
Each row starts from 0 and prints numbers up to one less than the current value of i, where i
decreases from 6 to 2.

Q:Write a Python program to print a diamond-like star pattern using loops.​


The pattern should have 4 rows of increasing stars followed by 3 rows of decreasing stars, with
appropriate spaces for alignment.
Q :Write a Python program that takes five numbers as input from the user and finds both the
minimum and maximum values among them.

Q :How will you use loops and spacing to ensure the pattern is symmetrical both above and
below the center line?
Q : How will you use nested loops to control the number of rows and the range of numbers
printed in each row?

Q : How will you use a break statement to exit the inner loop when the product of x and y
becomes greater than 10?
Q : How will you check if an element is already present in the new list before adding it?

Q : How will you use a loop and the append method to generate and store these (number, cube)
pairs in the list?
Q: How will you use the modulo operator to check for even and odd terms and print the
corresponding value in each case?

You might also like