Python Forum
How do we print this output?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do we print this output?
#1
Hi
I am trying to print this word output : s1 is today is a sunny
if i input this sentence "Today is a sunny day, let go to picnic"
I am unable to print the word "S1 is". I tried to use print ("s1 is" + str((s1[0:4]))
but meet error.

s1 = input("Enter 3 random strings, separated by commas:")
s1 = s1.split(',')
print (s1[0:4])
Appreciate for all advice. Thank you!
Reply


Messages In This Thread
How do we print this output? - by veve - May-13-2018, 03:59 PM
RE: How do we print this output? - by j.crater - May-13-2018, 04:07 PM
RE: How do we print this output? - by veve - May-14-2018, 12:13 AM
RE: How do we print this output? - by wavic - May-14-2018, 04:30 AM
RE: How do we print this output? - by veve - May-14-2018, 07:40 AM
RE: How do we print this output? - by wavic - May-14-2018, 08:35 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Print not appearing in output dgizzly 1 1,245 Oct-14-2022, 09:55 PM
Last Post: rob101
  Read text file, process data and print specific output Happythankyoumoreplease 3 2,962 Feb-20-2020, 12:19 PM
Last Post: jefsummers
  Need to print the output as follows Mac 2 3,366 Jul-19-2017, 06:52 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020