Python Forum
[split] assignment help
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[split] assignment help
#1
Greetings from Shobana

Professionally I'm an "Admin cum HR" in a consulting company. I am new to IT world, and started my Data Science course. I have more doubts in Phython of course totally new field without having a basic knowledge. So guys I want your help in my assignments.

I have attached the assignment given by my trainer and another is the assignment done by me, please clarify

Thank you
Yoriz write Nov-11-2022, 08:17 AM:
Please post all code, output and errors (in their entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.

Attached Files

Thumbnail(s)
       
Reply
#2
you should always post your questions in the Homework forum to be sure everyone sees it. and welcome to the Python Forums, Shobana!

the first line you have is:
var1 = First Name Shobana
i am not going to spend the time to type in your code from the picture image.

you need to put this text inside quotes so it makes it into one string like this:
var1 = " First Name Shobana "
notice the extra space i added. you should do that, too. do the same for the 2nd line and the third line. then put this in for var4:
var4 = (var1, var2, var3)
study line 4 very carefully and describe what you think it will do. how many strings will var4 have?

add you line 5 and run this to see what it does.

remember: literal strings need quotes to be sure python does not try to use it some other way.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#3
The leading and trailing white space is not required.
Split will work with or without leading and trailing whitespace.
Skaperen likes this post
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] University Assignment Help needed Nomathemba 4 3,659 Apr-20-2024, 12:24 PM
Last Post: jas31
  [split] Python for Everybody 5.2 assignment ramadan2099 3 12,095 Jul-15-2020, 04:54 PM
Last Post: Bipasha
  [split] Python for Everybody 5.2 assignment jonchanzw 4 8,521 Oct-22-2019, 08:08 AM
Last Post: perfringo
  [split] Need help with lists to continue my assignment code cylandur 7 9,505 Oct-11-2016, 03:11 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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