Python Forum
New Python Student = Does this code look right?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
New Python Student = Does this code look right?
#3
Generally, I wouldn't use
def yell_this(phrase = "Hey you"):
Instead, I would use :
def yell_this(phrase):
However, you can do it any way you want - it's your choice. Then later, you can either define the phrase and call the function like :
phrase1 = "Hey you!"
yell_this(phrase 1)
Or you can also do :
yell_this("Hey You!")
Either of the 2 ways, output will be same
pyzyx3qwerty
"The greatest glory in living lies not in never falling, but in rising every time we fall." - Nelson Mandela
Need help on the forum? Visit help @ python forum
For learning more and more about python, visit Python docs
Reply


Messages In This Thread
RE: New Python Student = Does this code look right? - by pyzyx3qwerty - May-06-2020, 08:42 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Student project - alert action when X happens Y amt of times, how? unknown00 2 1,826 Aug-25-2021, 08:07 PM
Last Post: namarang
  Student grader and sorter for assignment RazeAD 7 3,266 Feb-11-2021, 06:29 AM
Last Post: RazeAD
  Generating a student's transcript [OOP concept] aongkeko 2 2,746 Dec-01-2020, 06:43 AM
Last Post: buran
  Create code for input names and score for 15 student Davin 2 2,135 Sep-21-2020, 08:49 AM
Last Post: DeaD_EyE
  Student grade program help debug ccm1776 3 5,237 Nov-14-2018, 02:41 AM
Last Post: stullis

Forum Jump:

User Panel Messages

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