Тёмный

Swap uppercase and lowercase of text (hELLO to Hello) with code using Python and Rust 

timClicks
Подписаться 10 тыс.
Просмотров 595
50% 1

#Python #Rust #rustlang #programming #textprocessing
Learn how to swap uppercase and lowercase and text within a string using Python and Rust as example languages. This no-fluff tutorial is excellent for those people who like to learn by doing.
It's not the most efficient way to do this though. What are your suggested improvements?
Python code as a single function:
def invert_case(text: str):
opposites = {}
for (u, l) in zip(iter(text.upper()), iter(text.lower())):
opposites[u] = l
opposites[l] = u
return "".join(opposites[c] for c in iter(text))
Rust code available via this link: play.rust-lang...
📚 Resources:
Code: github.com/tim...
👋 Connect with Tim
www.youtube.co...
/ timmcnamaranz
/ timclicks
github.com/tim...
mastodon.nz/@t...
dev.to/timclicks/
/ timclicks
🔔 Subscribe to the channel and click the bell icon to stay updated with the latest videos and live streams from timClicks: www.youtube.co...
👍 Like this video if you found it helpful, and share it with your friends who are also interested in Rust programming.

Опубликовано:

 

13 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии    
Далее
Rust for Data Engineering: Working with Csv files.
1:51:44
Ванесса 🆚 Крискас  | WICSUR #shorts
00:42
ДЖЕФ  ЕЩЕ ПОМОГАЕТ!
09:37
Просмотров 480 тыс.
5 Useful F-String Tricks In Python
10:02
Просмотров 304 тыс.
Discussing effects in Rust's type system
10:34
Просмотров 1,1 тыс.
Combining Rust and Python: The Best of Both Worlds?
11:08
Why Rust is NOT a Passing Fad...
8:54
Просмотров 36 тыс.
Bresenham's Line Algorithm - Demystified Step by Step
16:10
This is Why Programming Is Hard For you
10:48
Просмотров 849 тыс.
Ванесса 🆚 Крискас  | WICSUR #shorts
00:42