Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Clarification
#1
This may seem like a stupid question.. But, I just started learning python today. And here is my dilemma, when coming across input I was confused as to why input would be used here and not str for example

name = input("What is your name: ")
age = int(input("How old are you: "))
year = str((2014 - age)+100)
print(name + " will be 100 years old in the year " + year)

Why wouldn't you use, name = str("What is your name: ")
Or could you use either and it is based off your preference, any clarification would be greatly appreciated
Reply


Messages In This Thread
Clarification - by Hammuel - Oct-29-2017, 10:37 PM
RE: Clarification - by Lux - Oct-29-2017, 11:40 PM
RE: Clarification - by Hammuel - Oct-30-2017, 12:22 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Can I get some clarification on importing functions from external files. wh33t 3 944 Feb-25-2023, 08:07 PM
Last Post: deanhystad
  Looking for clarification related to performance Pymon 5 2,106 Apr-04-2022, 04:47 PM
Last Post: deanhystad
  Read Tensorflow Documentation - Clarification IoannisDem 0 1,194 Aug-20-2021, 10:36 AM
Last Post: IoannisDem
  *args implementation and clarification about tuple status amjass12 10 4,142 Jul-07-2021, 10:29 AM
Last Post: amjass12
  Just need some clarification Tonje 3 2,109 Oct-01-2020, 03:52 PM
Last Post: deanhystad
  Global Variables - Some Points Needing Clarification. adt 4 3,005 Nov-30-2019, 01:23 PM
Last Post: adt

Forum Jump:

User Panel Messages

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