🔧 AI Nachrichten The Next Terrorist Attack Is Predictable(10.09.2026 um 23:41 Uhr)
🔧 AI Nachrichten Could A.I. Really Kill All Humans?(10.09.2026 um 23:53 Uhr)
🔧 AI Nachrichten Amazon Prime Video Uses A.I. for Lip-Synced Translations(11.09.2026 um 01:56 Uhr)
🔧 AI Nachrichten McClatchy Makes Deep Job Cuts to Newspapers Around the Country(11.09.2026 um 04:25 Uhr)
🔧 AI Nachrichten Law schools tell students to put AI away(07.09.2026 um 16:37 Uhr)
🔧 AI Nachrichten Can Huawei build China’s answer to ASML?(08.09.2026 um 04:57 Uhr)
🔧 AI Nachrichten AI is ushering in an era of mass toe-treading at work(08.09.2026 um 06:00 Uhr)
🔧 AI Nachrichten The Next Terrorist Attack Is Predictable(10.09.2026 um 23:41 Uhr)
🔧 AI Nachrichten Could A.I. Really Kill All Humans?(10.09.2026 um 23:53 Uhr)
🔧 AI Nachrichten Amazon Prime Video Uses A.I. for Lip-Synced Translations(11.09.2026 um 01:56 Uhr)
🔧 AI Nachrichten McClatchy Makes Deep Job Cuts to Newspapers Around the Country(11.09.2026 um 04:25 Uhr)
🔧 AI Nachrichten Law schools tell students to put AI away(07.09.2026 um 16:37 Uhr)
🔧 AI Nachrichten Can Huawei build China’s answer to ASML?(08.09.2026 um 04:57 Uhr)
🔧 AI Nachrichten AI is ushering in an era of mass toe-treading at work(08.09.2026 um 06:00 Uhr)

🔧 Programmierung 🕛 vor 1 Jahr 2 Min Lesezeit
0

Python Day 6- String Functions,Looping-For,ifelse conditions and Task

↗ Quelle (dev.to)
🗣️ Stimme:

Find():

Searches the string for a specified value and returns the position of where it was found.

Ex:




CODE
txt = "Hello, welcome to my world."

x = txt.find("welcome")

print(x)







Output:




CODE
7







So welcome is in 7th position as per indexing.If any other word is given which is not defined then the result will be -1.



Note:In the above example if index function is used instead of find,then it will display "valueerror: substring not found".If defined then output will be same like find function.



Looping:

For loop:

Ex:1




CODE
txt = '1234'

for num in txt:
print(num,end=' ')







Output:




CODE
1 2 3 4






Ex:2




CODE
name = input("Enter Name: ")
print(name)
for alphabet in name:
print(alphabet, end='*')






Output:




CODE
Enter Name: guru
guru
g*u*r*u*






Ifelse:

It runs the program with decision based on whether the statement is true or false.



Image description

Ex:




CODE
txt = '12a4'

for num in txt:
if num>='0' and num<='9':
print(num,end=' ')
else:
print('Not Decimal',end=' ')







Output:




CODE
1 2 Not Decimal 4 






In above example 1,2,4 are decimal but a is not a decimal so in output it shows not decimal as per else condition.



Task:



lakshmi Pritha

guru Prasanna

guhanraja

varatharajan



Find:

1: Names starting with letter 'g'

2: Names endings with 'a'

3: Names having space in between

4: Names having more than 9 letters




CODE
name=input("Enter names: ")
names=(name).split(",")

for letter in names:
if letter.startswith('g'):
print("Names starts with g are: ",letter)
else :
letter.endswith('a')
print("Names end with a are: ",letter)
for space in names:
for word in space:
if word==' ':
print("Names with space: ",space)
else:
continue
for character in names:
if len(character)>9:
print("Names with more than 9 letters: ",character)






output:




CODE
Enter names: guru prasanna,guhanraja,lakshmi pritha,varatharajan
Names starts with g are: guru prasanna
Names starts with g are: guhanraja
Names end with a are: lakshmi pritha
Names end with a are: varatharajan
Names with space: guru prasanna
Names with space: lakshmi pritha
Names with more than 9 letters: guru prasanna
Names with more than 9 letters: lakshmi pritha
Names with more than 9 letters: varatharajan




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
2 Quellen
Could A.I. Really Kill All Humans?
1 Quelle
The Next Terrorist Attack Is Predictable
1 Quelle
Anthropic Says It Blocked Possible Efforts to Build Biological Weapons
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Python Day 6- String Functions,Looping-For,ifelse conditions and Task

Thematisch verwandte Begriffe: Python, String, FunctionsLoopingForifelse, conditions · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...