Python Forum
Fraction Calculation with Limitations
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fraction Calculation with Limitations
#11
numerator = input_number(f'Enter number {numerator_values}: ', numerator_values)
print(numerator)
Reply
#12
(Dec-22-2020, 03:39 AM)bowlofred Wrote: print ('numerator') is not printing the variable numerator, it's printing the string "numerator". You would need to remove the quotes to reference the variable.

I removed the quotes and I get the whole list of possible numerator values 0 thru 15 not the number which was input.
Reply
#13
(Dec-22-2020, 04:18 AM)deanhystad Wrote: numerator = input_number(f'Enter number {numerator_values}: ', numerator_values)
print(numerator)

Thank you that worked fine! Smile
Reply
#14
On line 18 you ask for the value (via input) but instead of assigning it to a variable, it is just print()ed. Since it's not assigned, you don't have a record of it.

Assign it to a variable, and then you can print or do whatever.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Pytrends related querie & suggestion limitations cmg15326 0 557 May-02-2023, 03:47 PM
Last Post: cmg15326
  method to remove zero digits from fraction in decimal Skaperen 17 2,570 Oct-23-2022, 04:02 AM
Last Post: Skaperen
  fraction module: can you stop the reducing? qmfoam 1 2,349 Oct-10-2020, 06:10 PM
Last Post: bowlofred
  whole number and fraction Skaperen 11 5,457 Mar-17-2019, 11:33 PM
Last Post: Skaperen
  switch limitations MuntyScruntfundle 3 2,337 Jan-27-2019, 06:11 PM
Last Post: aakashjha001

Forum Jump:

User Panel Messages

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