Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Learning and need help
#1
Hey All, complete noob at this. Here is my question:

# This is my first python project
calc_to_secs = 24 * 60 * 60
num_of_days = input('Enter the number of days: ')
print(f'20 days are {calc_to_secs * num_of_days} seconds')
This gives result:

Output:
Enter the number of days: 2 20 days are 222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 seconds Process finished with exit code 0
What am I doing wrong?

thanks for help!
i tried this also:

# This is my first python project
calc_to_secs = 24 * 60 * 60
num_of_days = input('Enter the number of days: ')
print(num_of_days)
print(calc_to_secs)
calc_answer = num_of_days * calc_to_secs
print(calc_answer)
Yoriz write Jul-05-2021, 06:12 PM:
Please post all code, output and errors (in their 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.
Reply
#2
ok NM i fixed

# This is my first python project
calc_to_secs = 24 * 60 * 60
num_of_days = input('Enter the number of days: ')
print(num_of_days)
print(calc_to_secs)
calc_answer = int(num_of_days) * 24 * 60 * 60
print(calc_answer)
ibreeden likes this post
Reply


Forum Jump:

User Panel Messages

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