Ad
Fundamentals
Strings
Data Types
Algorithms
Logic
Code
Diff
  • def palindrome(word):return True if word == word[::-1] else False
    • def palindrome(word):
    • if word[::-1] == word:
    • return True
    • else:
    • return False
    • def palindrome(word):return True if word == word[::-1] else False
Code
Diff
  • def print_statements():
        # Printing lines of code:
        [print(x) for x in ["Hello Mark!","This is my first python script.","Python will be fun to learn!","I am not at COGS","I am at home in my jammies."]]
    • def print_statements():
    • # Printing lines of code:
    • print("Hello Mark!","This is my first python script.","Python will be fun to learn!","I am not at COGS","I am at home in my jammies.", sep="\n")
    • [print(x) for x in ["Hello Mark!","This is my first python script.","Python will be fun to learn!","I am not at COGS","I am at home in my jammies."]]