python string
#Strings in python are surrounded by either single quotation marks, or double quotation marks.
print("This is a string")
print('i am also a string')
python string
#Strings in python are surrounded by either single quotation marks, or double quotation marks.
print("This is a string")
print('i am also a string')
python string
string = 'amaama'
half = int(len(string) / 2)
if len(string) % 2 == 0: # even
first_str = string[:half]
second_str = string[half:]
else: # odd
first_str = string[:half]
second_str = string[half+1:]
# symmetric
if first_str == second_str:
print(string, 'string is symmertical')
else:
print(string, 'string is not symmertical')
# palindrome
if first_str == second_str[::-1]: # ''.join(reversed(second_str)) [slower]
print(string, 'string is palindrome')
else:
print(string, 'string is not palindrome')
string pythhon
a = '''my name is
coding boy
hasya'''
print(a)
#this is how string works
#it will print te value what you will enter
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us