-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbasicoperation.py
More file actions
51 lines (41 loc) · 939 Bytes
/
basicoperation.py
File metadata and controls
51 lines (41 loc) · 939 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
a=123 # integer
b=123.2 #float
c="abhishek" #string
d=None #none
print(type(a),type(b),type(c),type(d))
'''
This is a
multi line
comment
'''
e=input("Enter name:")
float(a)
print(type(a))
print(e[0:]) #slicing
print(e[0:4]) # slicing using positive index
print(e[-1]) #last character
print(e[-1:-4]) # slicing using negative index
print(r[::2]) #hoping
print(e[::-1]) #reverse
print(e[::-2]) #reverse and hop
print(len(e)) #length
["Abhishek","Kachhwaha"]
b=["CSE","COE"]
'''
#b= input("Enter college name:")
print(a.upper())
print(a.replace("Abhi","abhi"))
print(a.count("e"))
a=a.split()
a=' '.join(a)
print(a)
'''
print(a+b)
print(a*3)
print("Abhi" in a[0])
'''
what is python, why it is used widely and what are it's features?
Explain libraries of python (num,pi,panda)?
write a python program to perform basic concepts?
datatype,type,comment,input,typecasting,slicing['single','double'],length,indexing,join,+,in,*
'''