forked from hariom20singh/python-learning-codes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStandard_Function.py
More file actions
40 lines (35 loc) · 827 Bytes
/
Standard_Function.py
File metadata and controls
40 lines (35 loc) · 827 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
#1 print()
var = 'hello learners'
print(var)
print('This is line no.',4 )
print(123486)
a=[3,5,74,7]
print(a)
a='hello, '
b='rishabh '
print(a+b+'yadav')
#2 input()
a = input() #number input in a
print('this is a = {}'.format(a))
a=input()
print(a)
myName=input()
print('Hello, {}'.format(myName))
#3 len()-The len() function is used find the length(number of elements)
# of any python container like string, list, dictionary, tuple, etc.
a='hello '
print(len(a))
b="good boy"#for string
print(len(b))
a=[4,5,74,3,4]#for list
print(len(a))
a=('x','y','z')#for tuples
print(a)
print(len(a))
#4 ord() - The ord() function in Python will return an
#integer that represents the Unicode Character passed into it.
#It takes a single character as a parameter.
print(ord('a'))
print(ord('b'))
print(ord('A'))
print(ord('$'))