Basic for PYTHON.....
-March 1.3.2020
CONCEPT:
Introduction for Python.......and basic method.
PYTHON FACTS:
-This Developed by GUIDO VAN ROSSUM and released on February 20, IN 1991.
IMPORTANT 3 THINKS.
Indentation----> TO Avoid Unnecessary Space.
Colon ----> This must for Python.
Function:
CONTENTS:-
Primitives--> Number, strings, Boolean .
#INTEGERS --1, 2, 3, 4..........Numbers.
#FLOAT-- 1.2 , 5.6, 9.5,
#COMPLEX-- 5+2j
#VARIABLES
Example 1:
Watch=500
print(Watch)
output:
500
Example 2:
Watch=500
print(Watch+20)
output:
520
#STRING METHOD.
Example 1:
word1="hi dude"
word2="my age is 24!"
print(word2)
out put:
my age is 24!
IN PYTHON STRING CONVERTED IN ARRAY.
Array start in ZERO.
INDICES:
word1="HELLO"
print(word1[3])
output:
L
SLICING:
word3="HELLO"
print(word3[1:3])
output:
EL #Before array value in 3.
LENGTH:
word3="hello, world"
print(len(word3)) #keyword------len
output:
12
STRIP()
word2=" my age is 19"
print(word2) #Strip is used in removed in unnecessary space.
output:
Error #because word2 using unnecessary space.
word2="my age is 19"
print(word2)
output:
my age is 19
BOOLEAN:
Example 1:
word3="hello"
print("hell" in word3) #Boolean
#out put is --------> TRUE , FALSE
output:
TRUE
Example 2:
word3="latha"
print("hell"in word3)
output:
FALSE

No comments:
Post a Comment