开发者
编程技术、框架工具、最佳实践
共 7279 篇 · 第 235/364 页
At least one UK government department is reportedly done with X
UK attorney general Richard Hermer told his staff his office was quitting X, according to The Guardian and The Observer.
The room the economy can't see
Norway greenlights first full-scale ship tunnel
The Best Fitness Trackers of 2026: Garmin, Google Fitbit, and More
Find the right wearable for your lifestyle, workouts, and goals.
String Methods, Conditional Statements (if/elif/else), Loops (for, range())
🐍 Python for DevOps — Class 5 Notes Topic: String Methods, Conditional Statements ( if/elif/else ), Loops ( for , range() ) 📌 Key Concepts Overview Concept One-Line Definition String Methods Built-in functions to inspect and transform strings if / elif / else Execute code blocks based on conditions for loop Iterate over any iterable — string, list, range, dict range() Generate a sequence of numbers to loop over Nested if An if block inside another if block Nested for A for loop inside another for loop 🔤 Part 1 — String Methods (Continuation from Class 4) Checking String Case # islower() — True if ALL characters are lowercase ' devops ' . islower () # True ' Devops ' . islower () # False # isupper() — True if ALL characters are uppercase ' DEVOPS ' . isupper () # True ' Devops ' . isupper () # False # Practical: normalize before comparing env = input ( ' Enter environment: ' ) if env . lower () == ' production ' : print ( ' ⚠️ Deploying to PROD! ' ) Checking Digit / Numeric Strings Method Accepts Rejects DevOps Use isdecimal() 0-9 only decimals, superscripts Port validation isdigit() 0-9 + superscripts decimal points Version numbers isnumeric() 0-9 + superscripts + fractions decimal points Broadest check # Key difference — decimal point breaks all three ' 8080 ' . isdecimal () # True ' 8080 ' . isdigit () # True ' 8080 ' . isnumeric () # True ' 80.80 ' . isdecimal () # False — dot is not a digit ' 80.80 ' . isdigit () # False ' 80.80 ' . isnumeric () # False # DevOps use: validate user input before casting port_input = input ( ' Enter port: ' ) if port_input . isdecimal (): port = int ( port_input ) else : print ( ' ❌ Invalid port — must be a whole number ' ) replace() — Find and Replace in Strings # str.replace('old', 'new') ' Python ' . replace ( ' P ' , ' J ' ) # 'Jython' ' prod-server-01 ' . replace ( ' - ' , ' _ ' ) # 'prod_server_01' ' This is python class ' . replace ( ' i ' , ' a ' ) # 'Thas as python class' — ALL occurrences # DevOps: sanitize strings for us
Prediction Market Philosophers Got What They Wanted. They’re Not Happy About It
Getting the future right is now big business. But at a festival in Berkeley, forecasters worry that sports markets could take the whole industry down.
EU to soon classify AWS and Azure as gatekeepers under DSA
Rethinking Modularity in Ruby Applications
Rethinking modularity in Ruby applications
submitted by /u/noteflakes [link] [留言]
Plotnine
How to Deadlock a Java ExecutorService
submitted by /u/mlangc [link] [留言]
So You Want to Define a Well-Known URI
Renting vs. Buying – A case study for Bangalore
Vim Creator Bram Moolenaar's Forgotten Programming Language, Zimbu (2023)
DARPA Heavy Life Challenge
Fable Converted Pylint to Rust
Many Let's Encrypt renewals had errors today
FetchSandbox
API integration testing that remembers what breaks Discussion | Link