نتائج البحث: "#PythonStrings"

11 نتائج
IrisTech
IrisTech@IrisTechss·
I am a line of Python code I make numbers look pretty with commas and ₦ But mess up one f-string curly brace and… chaos What line am I? #Python #CodingJourney #PythonStrings
English
0
0
2
45
IrisTech
IrisTech@IrisTechss·
String power: Used .translate() with str.maketrans to remove punctuation: clean_text = desc.translate(str.maketrans("", "", string.punctuation)).strip(). Then split into words. Great for search normalization. #PythonStrings #PythonTips
English
0
0
0
11
IrisTech
IrisTech@IrisTechss·
String format deep dive: f-strings with expressions: f"Total: ₦{base_price * nights:,} ({nights} nights)" – formatted with commas. .zfill(2) on day strings for "01". Formatting output key for user-friendliness. #PythonStrings #PythonTips
English
0
0
0
7
IrisTech
IrisTech@IrisTechss·
String slicing practice: desc = "Standard room with queen bed". room_type = desc[desc.find("with"):].strip() → "with queen bed". Used .partition("with ") to split cleaner. String surgery satisfying. #PythonStrings #PythonTips #CodingJourney
English
0
0
0
2
IrisTech
IrisTech@IrisTechss·
String fun: Chained methods: raw_input = " DELTA VIEW ".strip().lower().replace("view", "Vista").title() → "Delta Vista". Cleaned + transformed in one line. String chaining addictive! #PythonStrings #PythonTips #CodingJourney
English
0
0
0
5
IrisTech
IrisTech@IrisTechss·
String deep dive: Used .find() and slicing: desc = "Deluxe room with king bed". if "king" in desc.lower(): room_type = desc[desc.find("king"):desc.find("bed")+3].strip() → "king bed". Parsing messy text! #PythonStrings #PythonTips #CodingJourney
English
0
0
0
5
IrisTech
IrisTech@IrisTechss·
String combo today: Used .replace() and .split() to clean input: raw = " iris-inn , deluxe ".strip().replace("-", " ").split(",") → cleaned = [s.strip().title() for s in raw] → ["Iris Inn", "Deluxe"]. Input handling smoother. #PythonStrings #PythonTips
English
0
0
0
9
IrisTech
IrisTech@IrisTechss·
String power move: Used .split() and .join() to clean user input: user_search = " iris inn ".strip().lower().split() → clean = " ".join(user_search).title() → "Iris Inn". Checked if clean in hotels. Super useful for search! #PythonStrings #PythonTips
English
0
0
0
6
IrisTech
IrisTech@IrisTechss·
String warm-up: Used .upper(), .lower(), .strip(), f-strings to format hotel names: clean_name = hotel["name"].strip().title() → "Iris Comfort". Printed f"Welcome to {clean_name} – only ₦{hotel['price']:,}!". Clean output in seconds. #PythonStrings #PythonTips
English
0
0
0
5