Showing posts with label python class 11. Show all posts
Showing posts with label python class 11. Show all posts

Saturday, 16 March 2019

string manipulation class 11 cbse

STRING MANIPULATION

STRING CREATION
  • By assigning value direct to the variable
>>> str ="I love myself"
>>> str
I love myself
  • By taking input
>>> str= input("enter a number")
     Enter a string This is python
>>> str 
     This is python

Transverse of a string

string1= input("Enter a string:")
print("The",string1,"in reverse order is:")
length= len(string1)
for a in range (-1,(-length),-1))
      print(sting1[a])

Membership operator in a string.

  • in operator result into True or False.
like= "a" is in "pradeep"will result into true.
  • not in
"k" not in "kumar" will result false.

String comparison operators

upper case and lower case has different unicode value.
EX. "A"=="a" false
       "abc"=="ABC" false
       "b"=="b" true

How to get unicode/ Ordinal value

>>>ord('a')
   97
>>>ord('A')
   65
>>> char(97)
   A

fundamental of python class 11 cbse part 3

PART 3

FLOWCHART

Flowchart is a graphical representation of an algorithm, workflow or process. The flowchart shows the steps as boxes of various kinds, and their order by connecting the boxes with arrow.

Conditional (if) statement.

In python, if statement is used to select statement is to be done on the basis of a condition, if statement.
if <condition>:
                statement.

if-else statement.

if<condition>:
                   statement when condition is true.
else:
      statement when condition is false.

if-elif statement.

a=int(input("Enter a number"))

if a==10:

           print("a is equal to 10")

elif a==20:

           print("a is equal to 20" )

else:

           print("a is not equal to 10 and 20")

NESTED if-else.

a=int(input("enter a no.")) 
b=int(input("enter a no."))
c=int(input("enter a no."))
if a>b:
        if a>c:
                  print("a is greater")
    else:
           print("c is greater")

in and not operator.

  • in operator 
           3 in [1,2,3,4] will return true.
           5 in [1,2,3,4] will return false.
  • not operator
           5 not in [1,2,3,4] will return true.

While loop

n=int(input("enter a no."))
c=1
while c<11:
           print(n,"x",c,"=",c*n)

JUMP STATEMENT(break)

n=int(input("enter a number"))
  c=1 
while c<11:
         is c==5:
              break
           print

CONTINUE STATEMENT

n=int("input a no."))
c=0
while c<11:
c=c+1
if c==5:
       continue
print (n,"x",c,"=",c*n)
           


Friday, 15 March 2019

computer system and organisation class 11 cbse

COMPUTER SYSTEM AND ORGANIZATION

Computer is an electronic device which can varieties of performance.

DATA

Data in computer terminology mean facts and figures.
             Eg: a boy open a the book of science.

Data is use o process he information when data is process it completes the information.
             Eg: A boy open the science book.

INPUT UNIT

It is responsible for taking input and convert it into binary.

C.P.U

Central processing unit. 

A.L.U

  • Arithmatic logic unit.
  • It performs the arithmatic (+,-,*) or logical (<,>,=<,=>) operation.
  • eg. when 2 no. are required to be added these no. are sent from memory to ALU.

 

C.U

Control unit

  • It may can control and guide the interpretation flow manipulation of data and information.
  • Cu is program executor.
  • Cu send signal to memory to send the information in the sequence of CU.

MEMORY

The memory is temporary and cannot be remember anything after it is switch off.

TYPES

 PRIMARY

 Temporary based memory
                  ex. RAM and ROM.

SECONDARY

Space is needed to store the data and information.
                  ex. BIT, GB, TB etc.

STORAGE UNIT

             HARD DISK

It stores information in one or more circular disk which are continues spinning. 

             CD

CD are relatively cheap and have a storage capacity of 780mb.

             DVD

It look like CD, it hold 15x as much as CD. And transfer 20x than CD.

             PENDRIVE

It is flash moving part like a storage device. It work like RAM.