Python Forum
question about python3 print function
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
question about python3 print function
#1
Hey all i've started with python 3 after using C for more than 2 years. Quick question, are the parenthesis normal after running this script? How would I eliminate them? Thanks?

#!/usr/bin/python3

def first_three_multiples (num):
    times_1 = num * 1
    times_2 = num * 2
    times_3 = num * 3

    return times_1, times_2, times_3

print (first_three_multiples (7))    # output 7, 14, 21
Program output:

(7, 14, 21)
Reply


Messages In This Thread
question about python3 print function - by jamie_01 - May-25-2020, 12:46 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  print doesnt work in a function ony 2 365 Mar-11-2024, 12:42 PM
Last Post: Pedroski55
  Question on dir() function Soorya25 1 1,207 Jan-16-2023, 09:33 PM
Last Post: deanhystad
  How to print variables in function? samuelbachorik 3 962 Dec-31-2022, 11:12 PM
Last Post: stevendaprano
  Question: print issue python202209 3 1,009 Sep-18-2022, 11:51 AM
Last Post: jefsummers
  How to print the output of a defined function bshoushtarian 4 1,367 Sep-08-2022, 01:44 PM
Last Post: deanhystad
  Function not scriptable: Noob question kaega2 3 1,239 Aug-21-2022, 04:37 PM
Last Post: kaega2
  input function question barryjo 12 2,839 Jan-18-2022, 12:11 AM
Last Post: barryjo
  Why does absence of print command outputs quotes in function? Mark17 2 1,437 Jan-04-2022, 07:08 PM
Last Post: ndc85430
  return vs. print in nested function example Mark17 4 1,815 Jan-04-2022, 06:02 PM
Last Post: jefsummers
Exclamation question about input, while loop, then print jamie_01 5 2,750 Sep-30-2021, 12:46 PM
Last Post: Underscore

Forum Jump:

User Panel Messages

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