day -7 task

i have completed my task please let me know if found any mistake in comment box

Write a function that takes a string and returns a new string consisting of its first and last character.

number=”tamizhnadu”
number[0:10:9]


This content originally appeared on DEV Community and was authored by PERUMAL S

i have completed my task please let me know if found any mistake in comment box

Write a function that takes a string and returns a new string consisting of its first and last character.

number="tamizhnadu"
number[0:10:9]

Write a function that reverses a given string.

number[-1:-11:-1]

Given a string, extract and return a substring from the 3rd to the 8th character (inclusive).

num1="inclusive"
num1[2:9]

Write a function that returns every second character from a given string.

num1[2:9:2]

Write a function that checks if a given string is a palindrome (reads the same backward as forward).

name="civic"
print(name[0:4+1])
print(name[-1:-6:-1])

Given an email address, extract and return the domain.

mail="dummy@gmail.com"
mail[6:]

Write a function that returns every third character from a given string.

mail="dummy@gmail.com"
mail[2:15:3]

Write a function that extracts and returns characters at even indices from a given string.

mail[2:15:2]

Write a function that skips every second character and then reverses the resulting string.

mail[-1:-16:-2]


This content originally appeared on DEV Community and was authored by PERUMAL S


Print Share Comment Cite Upload Translate Updates
APA

PERUMAL S | Sciencx (2024-07-22T17:44:22+00:00) day -7 task. Retrieved from https://www.scien.cx/2024/07/22/day-7-task/

MLA
" » day -7 task." PERUMAL S | Sciencx - Monday July 22, 2024, https://www.scien.cx/2024/07/22/day-7-task/
HARVARD
PERUMAL S | Sciencx Monday July 22, 2024 » day -7 task., viewed ,<https://www.scien.cx/2024/07/22/day-7-task/>
VANCOUVER
PERUMAL S | Sciencx - » day -7 task. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/07/22/day-7-task/
CHICAGO
" » day -7 task." PERUMAL S | Sciencx - Accessed . https://www.scien.cx/2024/07/22/day-7-task/
IEEE
" » day -7 task." PERUMAL S | Sciencx [Online]. Available: https://www.scien.cx/2024/07/22/day-7-task/. [Accessed: ]
rf:citation
» day -7 task | PERUMAL S | Sciencx | https://www.scien.cx/2024/07/22/day-7-task/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.