ru
Feedback
Python Codes Basic to Advance

Python Codes Basic to Advance

Открыть в Telegram
2 813
Подписчики
Нет данных24 часа
-47 дней
-2430 день
Архив постов
# Triangle pattern 🔺️ n = 6 for i in range(n): print(" " * (n - 1 - i), end="") print("* " * (i + 1)) # @python_codes_pro

╱╱┏╮ ╱╱┃┃ ▉━╯┗━╮ ▉┈┈┈┈┃ ▉╮┈┈┈┃ ╱╰━━━╯ I hope you like it

# 15. str.isnumeric(): numeric_string = "12345" is_numeric = numeric_string.isnumeric() print(is_numeric) # @python_codes_pro

/py # 15. str.isnumeric(): numeric_string = "12345" is_numeric = numeric_string.isnumeric() print(is_numeric) # @python_codes_pro

# 14. str.isalpha(): alphabetic_string = "Hello" is_alpha = alphabetic_string.isalpha() print(is_alpha) # @python_codes_pro

/py # 14. str.isalpha(): alphabetic_string = "Hello" is_alpha = alphabetic_string.isalpha() print(is_alpha) # @python_codes_pro

# 13. str.isdigit(): numeric_string = "12345" is_digit = numeric_string.isdigit() print(is_digit) # @python_codes_pro

/py # 13. str.isdigit(): numeric_string = "12345" is_digit = numeric_string.isdigit() print(is_digit) # @python_codes_pro

# 12. str.join(iterable): words = ['Hello', 'World'] my_string = ' '.join(words) print(my_string) # @python_codes_pro

/py # 12. str.join(iterable): words = ['Hello', 'World'] my_string = ' '.join(words) print(my_string) # @python_codes_pro

# 11. str.split(sep=" "): my_string = "Hello, World!" words = my_string.split() print(words) # @python_codes_pro

/py # 11. str.split(sep=" "): my_string = "Hello, World!" words = my_string.split() print(words) # @python_codes_pro

# 10. str.replace(old, new): my_string = "Hello, World!" new_string = my_string.replace("Hello", "Hi") print(new_string) # @python_codes_pro

/py # 10. str.replace(old, new): my_string = "Hello, World!" new_string = my_string.replace("Hello", "Hi") print(new_string) # @python_codes_pro

# 9. str.format(*args, **kwargs): name = "Alice" age = 25 formatted_string = "My name is {} and I'm {} years old.".format(name, age) print(formatted_string) # @python_codes_pro

/py # 9. str.format(*args, **kwargs): name = "Alice" age = 25 formatted_string = "My name is {} and I'm {} years old.".format(name, age) print(formatted_string) # @python_codes_pro

# 8. str.endswith(suffix): my_string = "Hello, World!" ends_with_world = my_string.endswith("World!") print(ends_with_world) # @python_codes_pro

/py # 8. str.endswith(suffix): my_string = "Hello, World!" ends_with_world = my_string.endswith("World!") print(ends_with_world) # @python_codes_pro

╱╱┏╮ ╱╱┃┃ ▉━╯┗━╮ ▉┈┈┈┈┃ ▉╮┈┈┈┃ ╱╰━━━╯ I hope you like it

# 7. str.startswith(prefix): my_string = "Hello, World!" starts_with_hello = my_string.startswith("Hello") print(starts_with_hello) # @python_codes_pro