Skip to content
Pooja Bhatia Classes Hari Nagar
  • We teach following classes
    • Class 12
    • Class 11
    • Class 10
    • Class 9
  • Sumita Arora IP/CS Solutions
  • Jobs/Internship
Pooja Bhatia Classes Hari Nagar

sa 12 cs chapter 3

9. Write a program that generates a series using a function which takes first and last values of the series and then generates four terms that are equidistant e.g., if two numbers passed are 1 and 7 then function returns 1 3 5 7.

sa 12 cs chapter 3 / PythonCSIP CS IP

# Code def func(x, y): d = (y-x)/3 # divides the difference in 3 equal parts return [x, x+d, x+2*d, y] # returns the series as a list print(func(1, 9)) print(func(4, 8)) print(func(4, 10)) print(func(1, 7)) # Output [1, 3.6666666666666665, 6.333333333333333, 9] [4, 5.333333333333333, 6.666666666666666, 8] [4, 6.0, 8.0, 10] [1, 3.0, 5.0, 7]

9. Write a program that generates a series using a function which takes first and last values of the series and then generates four terms that are equidistant e.g., if two numbers passed are 1 and 7 then function returns 1 3 5 7. Read More »

3. Write a program to have following functions :

sa 12 cs chapter 3 / PythonCSIP CS IP

3. Write a program to have following functions : Read More »

Post pagination
1 2 … 21 Next →
  • We teach following classes
    • Class 12
    • Class 11
    • Class 10
    • Class 9
  • Sumita Arora IP/CS Solutions
  • Jobs/Internship
  • We teach following classes
  • Sumita Arora IP/CS Solutions
  • Jobs/Internship

Copyright © 2025 Pooja Bhatia Classes Hari Nagar | Powered by Pooja Bhatia Classes Hari Nagar.