Friday, 18 February 2022

Modify the chaos program so that the number of values to print is determined by the user. You will have to add a line near the top of the program to get another value from the user:

 Modify the chaos program so that the number of values to print is determined by the user. You will have to add a line near the top of the program to get another value from the user:

n = eval(input("How many numbers should I print? ") ) Then you will need to change the loop to use n instead of a specific number.

CODE

def main():

    print("This program illustrates a chaotic function")

    n = eval(input("How many numbers should I Print ?"))

    x = eval(input("Enter a number between 0 and 1: "))

    for i in range(n):

        x = 3.9 * x * (1 - x)

        print(x)


main()

Note : Save above file as chaos_v2.py

SCREENSHOT



Modify the chaos program so that it prints out 20 values instead of 10.

 

CODE

def main():

    print("This program illustrates a chaotic function")

    x = eval(input("Enter a number between 0 and 1: "))

    for i in range(20):

        x = 3.9 * x * (1 - x)

        print(x)


main()

Note : Save above code as chaos_v3.py

SCREENSHOT




Modify the chaos program using 2.0 in place of 3.9 as the multiplier in the logistic function.

 Modify the chaos program using 2.0 in place of 3.9 as the multiplier in the logistic function.

Your modified line of code should look like this: X = 2. 0 * X * (1 - X)

CODE

def main():

    print("This program illustrates a chaotic function")

    x = eval(input("Enter a number between 0 and 1: "))

    for i in range(10):

        x = 2.0 * x * (1 - x)

        print(x)


main()

Note : Save above code as chaos_v1.py  

SCREENSHOT



Enter and run the chaos program

 

CODE

def main():

    print("This program illustrates a chaotic function")

    x = eval(input("Enter a number between 0 and 1: "))

    for i in range(10):

        x = 3.9 * x * (1 - x)

        print(x)


main()

Note : Save above code as chaos.py

SCREENSHOT



Friday, 4 February 2022

Python Program : 2 Write a Python Program to find summation of two numbers

 

CODE

def main():

    x=10

    y=20

    sum = x + y

    print("X's Value=",x)

    print("Y's Value=",y)

    print("Summation of X + Y =",sum)

main()

Note : Save above code as prog2.py

SCREENSHOT



Python Program : 1 Write a Python Program to print Hello World

CODE

 def main():

    print("Hello World")

main()


Note : Save above code as prog1.py

SCREENSHOT 



Saturday, 11 February 2017

Std 11 Chapter 11 Wild Card Character



  • Wild Card Character Asterisk (*) sign Returns Remaining Character of the Conditions Value.

For e.g. Like ‘M*’: They Returns Name Start with M but Remaining Character after M is Any Character.

Std 11 Chapter 11 Operators Examples in Base


  • Some Important Operators Examples:



 

No.
Name of Operators
Examples
1
And
1. 100 And 200 2. ‘Anand’ And ‘Nadiad’
2
Or
1. 100 Or 200    2. ‘Maulik’ Or ‘Paresh’
3
Not
1. Not 5             2. Not(‘Anand’)
4
Like
1. Like ‘M*’
5
Is
1.Is Not Empty (The Field Value is not Set Empty)
6
In
1.In(‘Anand’)
7
Between
1.Between #1/6/2005# And #11/1/2012#