CodeSolved

A comprehensive source of programming questions and exercises

Cutting the text

Practice Easy 62/ Download 1798 Views

Write a program that receives a text from the input and, as in the example below, print from the first to the first point of that text


ENTER: My name is amirhossein. I live in tehran.
My name is amirhossein

22 Answers

This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
def text():
    text = input('enter a text :')
    text=text.partition('.')
    print(text[0])
text()
i = input("E :")
s = i.find("." + "n." +"i." + "..")
print(i)
E=Amir.hossein.Naei.      ..
J1625 Download Python
# Receive Input and Construction
Text = input('Please enter text : ')
dot = 0

# Find the first point
dot = Text.find('.')

# Remove the additional sections and display the result
if dot != -1 :
    print('\n\n  ' + Text[:dot])

else :
    print('\n\n  ' + Text)
inStr=input("matn ra vared konid: ")
print(inStr[:inStr.find('.')])
Saeeda33 Download Python
# Taking the text from the input
Text = input('Enter Text:')
# Find the first point in the text
find = Text.find('.')
# Printing up to the first point of the text
print(Text[0:find])
def tx(text):
    x = text[0:28+1]
    return x
print(tx(text=input("enter your name:")))
x = input('your string:')
y = x.find('.')
print(x)
Mohamad Download Python
<< Previous page 1 2 3 Next page >>

Submit answer

Submitting answers is currently unavailable.

Related content

Detection using AI
×
×
Close