Answers for "python {} string"

0

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')
Posted by: Guest on June-30-2021
0

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')
Posted by: Guest on February-05-2022
0

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
Posted by: Guest on January-12-2022

Python Answers by Framework

Browse Popular Code Answers by Language