Skip to content

Create SumOfNatural.py - #2

Open
ulharetushar wants to merge 11 commits into
tusharulhare:masterfrom
ulharetushar:master
Open

Create SumOfNatural.py#2
ulharetushar wants to merge 11 commits into
tusharulhare:masterfrom
ulharetushar:master

Conversation

@ulharetushar

Copy link
Copy Markdown

iven a positive integer N. The task is to find 12 + 22 + 32 + ….. + N2.

iven a positive integer N. The task is to find 12 + 22 + 32 + ….. + N2.
Python code using ord function :
ord() : It coverts the given string of length one, return an integer representing the unicode code point of the character. For example, ord(‘a’) returns the integer 97.
Using slicing technique
This is the easiest and the fastest way to clone a list. This method is considered when we want to modify a list and also keep a copy of the original. In this we make a copy of the list itself, along with the reference. This process is also called cloning. This technique takes about 0.039 seconds and is the fastest technique.Output:
Original List: [4, 8, 2, 10, 15, 18]
After Cloning: [4, 8, 2, 10, 15, 18]
Using slicing technique
This is the easiest and the fastest way to clone a list. This method is considered when we want to modify a list and also keep a copy of the original. In this we make a copy of the list itself, along with the reference. This process is also called cloning. This technique takes about 0.039 seconds and is the fastest technique.Output:
Original List: [4, 8, 2, 10, 15, 18]
After Cloning: [4, 8, 2, 10, 15, 18]
Given a string, write a python function to check if it is palindrome or not. A string is said to be palindrome if reverse of the string is same as string. For example, “radar” is palindrome, but “radix” is not palindrome
Given a string, write a python function to check if it is palindrome or not. A string is said to be palindrome if reverse of the string is same as string. For example, “radar” is palindrome, but “radix” is not palindrome
Given a string, write a python function to check if it is palindrome or not. A string is said to be palindrome if reverse of the string is same as string. For example, “radar” is palindrome, but “radix” is not palindrome
Above is Python code to Split and Join the string based on a delimiter.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@ulharetushar