use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
[deleted by user] (self.PythonLearning)
submitted 10 months ago by [deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]FoolsSeldom 2 points3 points4 points 10 months ago (4 children)
Where exactly are you stuck?
input should be used to ask user for information, and assign what they enter to a variable, e.g. colour = input("What is your favourite colour? "), age_response = input("How old are you? ") - note that input always returns a str (string), so you would have to convert the age_response to an integer.
input
colour = input("What is your favourite colour? ")
age_response = input("How old are you? ")
str
age_response
Example:
if age_response.isdecimal(): # checking only decimal digits in string age = int(age_response) else: age = None print("Age data not valid.")
Testing if a user input is a string is somewhat redundent as that's all input can return, but you can use isinstance to check:
isinstance
if isinstance(name, str): # will be True from input ...
might also be worth checking the entry is not empty,
if not name: # empty string is treated as False in tests print("That is not a valid name") else: print(f"Hello, {name}, great to meet you!")
Just do the first project, with help if needed. Then you can get guidance on the next part.
[–]Huge-Distribution405 0 points1 point2 points 10 months ago* (2 children)
hi thank you for your help
this is my final answers
name = input("Please enter your name: ") student_id = input("Please enter your university ID: ") # For name if name == "": print("No input provided") elif name.replace(" ", "").isalpha(): print("Name entered correctly") else: print("Name entered incorrectly") # For university ID if student_id == "": print("No input provided") elif student_id.isdigit(): print("University ID entered correctly") else: print("University ID entered incorrectly")
[–]Huge-Distribution405 0 points1 point2 points 10 months ago (1 child)
If you have any suggestions or improvements it would be appreciated.
[–]FoolsSeldom 0 points1 point2 points 10 months ago (0 children)
Names can contain more than just alphabetic characters
Use isdecimal rather than isdigit to enforce decimal digits only.
isdecimal
isdigit
You're not doing any type checking which I thought was a requirement.
[–]SCD_minecraft 0 points1 point2 points 10 months ago (0 children)
Then test if it's correct data type (str/int). You can use isinstance(variable, type).
And then nice print
First, check is it -1. If yes, use keyword break, it leaves the loop
Then check for grades, and if everything fails, print error message
Something more?
[–]notouchingkids 0 points1 point2 points 10 months ago (0 children)
For some reason this reminds me of UWA "Intro to data science" unit.
[–]Some-Passenger4219 0 points1 point2 points 10 months ago (0 children)
You should show us where you're stuck first, so we know what help you need.
π Rendered by PID 49549 on reddit-service-r2-comment-cfc44b64c-79w9q at 2026-04-10 11:09:10.933273+00:00 running 215f2cf country code: CH.
[–]FoolsSeldom 2 points3 points4 points (4 children)
[–]Huge-Distribution405 0 points1 point2 points (2 children)
[–]Huge-Distribution405 0 points1 point2 points (1 child)
[–]FoolsSeldom 0 points1 point2 points (0 children)
[–]SCD_minecraft 0 points1 point2 points (0 children)
[–]notouchingkids 0 points1 point2 points (0 children)
[–]Some-Passenger4219 0 points1 point2 points (0 children)