-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstring operations in python.py
More file actions
41 lines (40 loc) · 1.33 KB
/
Copy pathstring operations in python.py
File metadata and controls
41 lines (40 loc) · 1.33 KB
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
# """slicing of string in python """
#
# string_input = "I am happy to learn python"
#
# print(len(string_input))
# print(string_input[5])
#
# string_slicing= string_input[2:5]
# print(string_slicing)
#
# string_slicing= string_input[2:6:1]
# print(string_slicing)
#
# string_slicing= string_input[1+1:9-2:1*1]
# print(string_slicing)
#
# """ fstring in python - formating the string."""
#
# first_name ="Ajit"
# last_name="Sakhare"
# course ="Python"
# marks=80
#
# print(first_name,"has took",course,"course online and completed with",marks,"% marks")
# print(f"{first_name} has took {course} course online and completed with {marks} % marks")
# ajit_details=f"{first_name} has took {course} course online and completed with {marks} % marks"
# print(ajit_details)
#
# """Escape sequence in python"""
#
# print("it's ok sometimes things not go well")
# print('it\'s ok sometimes things not go well')
# print("it\"s ok sometimes things not go well")
# print('it"s ok sometimes things not go well')
# print('its ok sometimes\nthings not go\twell')
# print('it\'s ok sometimes things go good\\bad in life')
#Operations in python
#print("ajit"+"sakhare") #string concatination with "+" operator
# print("ajit" * "sakhare") this not works
# print("ajit" * 3) # output - ajitajitajit its repeatative of world or string.