Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 2
ŠŠ“ŃŠ°Š²ŃŃŠ²ŃŠ¹ŃŠµ! ŠŠ°Š²ŠµŠ“ŠøŃŠµ ŠæŠ¾Š¶Š°Š»ŃŠ¹ŃŃŠ° Š½Š° ŃŠµŃŠµŠ½ŠøŠµ Š·Š°Š“Š°ŃŠø Š½Š° pythn ŃŠ°Š¼Š¾Šµ Š“Š»ŠøŠ½Š½Š¾Šµ ŃŠ»Š¾Š²Š¾.
ŠŠ¾Ń Š¾ŠæŠøŃŠ°Š½ŠøŠµ. ŠŃŠæŠ¾Š»ŃŠ·ŃŃ ŃŠµŠŗŃŃ Š² ŠŗŠ°ŃŠµŃŃŠ²Šµ Š²Š²Š¾Š“Š½ŃŃ Š“Š°Š½Š½ŃŃ , Š½Š°Š¹Š“ŠøŃŠµ Šø Š²ŃŠ²ŠµŠ“ŠøŃŠµ Š² ŃŠµŠ·ŃŠ»ŃŃŠ°Ń ŃŠ°Š¼Š¾Šµ Š“Š»ŠøŠ½Š½Š¾Šµ ŃŠ»Š¾Š²Š¾. ŠŃŠøŠ¼ŠµŃ Š²Š²Š¾Š“Š½ŃŃ Š“Š°Š½Š½ŃŃ this is an awesome text ŠŃŠøŠ¼ŠµŃ ŃŠµŠ·ŃŠ»ŃŃŠ°ŃŠ° awesome
13 Respostas
+ 12
txt = input()
f=(txt.split())
mnr = 0
max = len(f[mnr])
for i in range(len(f)):
if len(f[i]) > max:
max = len(f[i])
mnr = i
print(f[mnr])
+ 5
txt = input()
l=txt.split()
longword=''
for word in l:
if len(word) > len(longword):
longword = word
print (longword )
+ 3
txt = input()
y=txt.split()
x=[]
z=0
for i in y:
a=len(i)
x.insert(z, a)
z+=1
z=(max(x))
g=(x.index(z))
print(y[g])
ŠŃŠ¾ Š¾ŃŠµŠ½Ń ŃŠ»Š¾Š¶Š½Š¾ Šø Š·Š°Š¼ŃŠ“ŃŠµŠ½Š½Š¾, Š½Š¾ ŃŠ°Š±Š¾ŃŠ°ŠµŃ
+ 1
txt =(input())
text_split=txt.split()
summ_word=len(text_split)
new_list = []
for i in range(len(text_split)):
a=len(text_split[i])
new_list.append(int(a))
print(text_split[(new_list.index((max(new_list))))])
0
ŠŠµ Š¼Š¾Š³Ń!
Š£Š¶Šµ ŠæŠ¾Š» Š“Š½Ń Š³Š¾Š»Š¾Š²Ń Š»Š¾Š¼Š°Ń!
ŠŠ¾Š¼Š¾Š³ŠøŃŠµ ŠæŠ¾Š¶Š°Š»ŃŠ¹ŃŃŠ°!
0
It is not hard at all if you know what methods to use.
Consider using split() that can break down a sentence into a list of words, and then, from that list find the longest string.
0
Š”ŠæŠ°ŃŠøŠ±Š¾!
0
Š”ŠæŠ°ŃŠøŠ±Š¾ Š±Š¾Š»ŃŃŠ¾Šµ!
0
ŠŠ¾Š¶Š°Š»ŃŠ¹ŃŃŠ°
0
def longword(word):
listword=word.split()
library={}
for x in listword:
library[len(x)]=x
print(library[max(library)])
longword(input())
0
txt = input()
text=txt.split()
word=0
for i in range(len(text)):
if len(text[i])>len(text[word]):
word=i
print (text[word])
0
ŠŠ¾Š¶Š°Š»ŃŠ¹ŃŃŠ° txt = input()
word=txt.split()
print(max(word, key=len))
0
txt = input()
y=txt.split()
z=[len(i) for i in y]
p=z.index(max(z))
print (y[p])