Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
class homework
#1
Hi I wanted to get some help on how I could solve this python problem as I am just a beginner in python.
allow the user to enter their school code and last names and will output their username in the school format (up to 5 letters from their lastname, or 4 if there are any spaces, followed by their school id number)

this is the code I have done so far:
person = input("Enter your last name: ")
school_ID = int(input("Enter your school number: "))
def count_chars(txt):
	result = 0
	for char in txt:
		result += 1
	return result
print(person, school_ID)
Any help in how I should move forward would be much appreciated.
Larz60+ write Oct-28-2020, 02:31 AM:
Please post all code, output and errors (it it's 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.

I've fixed it this time. Please use bbcode tags on future posts.
Thank you
Reply


Messages In This Thread
class homework - by mohan10216 - Oct-28-2020, 12:40 AM
RE: class homework - by Askic - Oct-28-2020, 05:09 PM
RE: class homework - by jefsummers - Oct-28-2020, 06:28 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Class Homework Cowboy 1 2,530 Nov-16-2017, 01:56 AM
Last Post: sparkz_alot

Forum Jump:

User Panel Messages

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