🪟 Windows TippsWindows 10 weiter stabil - die Nutzerzahlen im August 2026(05.09.2026 um 18:20 Uhr)
🐧 Linux TippsCC2tv #433: Was CachyOS anders macht als Linux Mint 🐧️(29.08.2026 um 10:00 Uhr)
🔧 ProgrammierungArti 2.6.0 released(01.09.2026 um 02:00 Uhr)
🔧 ProgrammierungGitHub Release: dependabot/dependabot-core v0.393.0 (24.08.2026)(24.08.2026 um 17:26 Uhr)
🪟 Windows TippsGitHub Release: dependabot/dependabot-core v0.394.0 (31.08.2026)(31.08.2026 um 17:46 Uhr)
🔧 ProgrammierungGitHub Release: dependabot/dependabot-core v0.395.0 (07.09.2026)(07.09.2026 um 15:21 Uhr)
🔧 ProgrammierungGitHub Release: langwatch/scenario vjavascript/v1.4.0 (26.08.2026)(26.08.2026 um 09:05 Uhr)
🔧 ProgrammierungGitHub Release: langwatch/scenario vpython/v1.4.0 (02.09.2026)(02.09.2026 um 04:47 Uhr)
🪟 Windows TippsWindows 10 weiter stabil - die Nutzerzahlen im August 2026(05.09.2026 um 18:20 Uhr)
🐧 Linux TippsCC2tv #433: Was CachyOS anders macht als Linux Mint 🐧️(29.08.2026 um 10:00 Uhr)
🔧 ProgrammierungArti 2.6.0 released(01.09.2026 um 02:00 Uhr)
🔧 ProgrammierungGitHub Release: dependabot/dependabot-core v0.393.0 (24.08.2026)(24.08.2026 um 17:26 Uhr)
🪟 Windows TippsGitHub Release: dependabot/dependabot-core v0.394.0 (31.08.2026)(31.08.2026 um 17:46 Uhr)
🔧 ProgrammierungGitHub Release: dependabot/dependabot-core v0.395.0 (07.09.2026)(07.09.2026 um 15:21 Uhr)
🔧 ProgrammierungGitHub Release: langwatch/scenario vjavascript/v1.4.0 (26.08.2026)(26.08.2026 um 09:05 Uhr)
🔧 ProgrammierungGitHub Release: langwatch/scenario vpython/v1.4.0 (02.09.2026)(02.09.2026 um 04:47 Uhr)

🔧 Programmierung 🕛 vor 1 Jahr 4 Min Lesezeit
0

Day 20 - String functions

↗ Quelle (dev.to)
🗣️ Stimme:

1.Write a program to check given key is available or not:




CODE
txt = "I love many fruits, apple is my favorite fruit"
key = 'fruit'
l = len(key)
start = 0
end = l
while end<=len(txt):
if txt[start:end] == key:
print('Contains', key)
break
start+=1
end+=1
else:
print('Not Contains')









CODE
Contains fruit






2.Write a program to find given key position:



find() returns the position of where it was found.




CODE
txt = "Python is my Favourite Language"
key = 'Python'
l = len(key)
start = 0
end = l
while end<=len(txt):
if txt[start:end] == key:
print('Contains', key)
print(start,end-1)
break
start+=1
end+=1
else:
print('Not Contains')










CODE
Contains Python
0 5







3.Write a program to check the word starts with the specified key:



startswith() check if the string starts with the specified value.




CODE
txt = "Python is my Favourite Language"
key = 'Python'
l = len(key)
start = 0
end = l
while end<=len(txt):
if txt[start:end] == key:
if start==0:
print("Starts with", key)
break
start+=1
end+=1
else:
print('Not Contains')










CODE
Starts with Python






Another way to check the word starts with the specified key:




CODE
txt = "Apples are good, apple is my favorite fruit"
key = 'Apple'
l = len(key)
if txt[0:l]==key:
print('Starts with',key)










CODE
Starts with Apple






4.Write a program to check the word ends with the specified key:



endswith() check if the string ends with the specified value.




CODE
txt = "My Favourite Language is Python"
key = 'Python'
l = len(key)
start = 0
end = l
while end<=len(txt):
if txt[start:end] == key:
if end==len(txt):
print("Ends with", key)
break
start+=1
end+=1
else:
print('Not Contains')









CODE
Ends with Python






Another way to check the word ends with the specified key:




CODE
txt = "Apples are good, apple is my favorite fruit"
key = 'fruit'
l = len(key)
if txt[-l:]==key:
print('Ends with',key)










CODE
Ends with fruit






5.Write a program to check the given word is alpha or not:



isalpha() check all characters in the string are alphabet.




CODE
alpha = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
word = 'abcdEFGH'
for letter in word:
if letter not in alpha:
print('Not all are alphabets')
break
else:
print('All are alphabets')









CODE
All are alphabets






6.Write a program to check the given word is alnum or not:



isalnum() checks all characters in the string are alphanumeric.




CODE
alpha = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
word = '[email protected]'
for letter in word:
if letter not in alpha:
print('Not all are alphabets and numbers')
break
else:
print('All are alphabets and numbers')









CODE
Not all are alphabets and numbers






7.Write a program to check the given word is lowercase or not:



islower() checks all characters in the string are lower case.




CODE
alpha = 'abcdefghijklmnopqrstuvwxyz'
word = 'lakshmipritha'
for letter in word:
if letter not in alpha:
print('Not all are lowercase alphabets')
break
else:
print('All are lowercase alphabets')









CODE
All are lowercase alphabets






8.Write a program to check the given word is uppercase or not:



isupper() checks all characters in the string are upper case.




CODE
alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
word = 'LAKSHMIPRITHA'
for letter in word:
if letter not in alpha:
print('Not all are uppercase alphabets')
break
else:
print('All are uppercase alphabets')









CODE
All are uppercase alphabets






Task:



1.Write a program to convert Uppercase into lowercase:



lower() converts a string into lower case.




CODE
txt = "HELLO, AND WELCOME TO MY WORLD!"
for letter in txt:
if letter>='A' and letter<'Z':
letter = ord(letter)+32
letter = chr(letter)
print(letter,end='')










CODE
hello, and welcome to my world!






2.Write a program to convert lowercase into uppercase:



upper() converts a string into upper case.




CODE
txt = "hello, and welcome to my world!"
for letter in txt:
if letter>='a' and letter<'z':
letter = ord(letter)-32
letter = chr(letter)
print(letter,end='')









CODE
HELLO, AND WELCOME TO MY WORLD!






3.Write a program to check space is available or not:



isspace() checks spaces in the text.




CODE
txt  = 'Rose Is A Beautiful Flower'

if txt[0]>='A' and txt[0]<='Z':
i = 1
while i<len(txt):
if txt[i]>='A' and txt[i]<='Z':
if txt[i-1]==' ':
print("Space is there")
break
i+=1
else:
print("No space is there")









CODE
Space is there



Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
1 Quelle
Windows 10 und 11: Update zerschießt Druckfunktion und PDF-Export
1 Quelle
Nvidia killt Windows-10-Support - Bald keine Game-Ready-Treiber mehr
1 Quelle
Windows 10 weiter stabil - die Nutzerzahlen im August 2026
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Day 20 - String functions

Thematisch verwandte Begriffe: String, functions · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...