Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem with syntax error
#3
I'll also add, since your practicing, it is a good idea to avoid bad habits before they become habits, so familiarize yourself with this document: Python Style Guide

Make sure your closing parenthesis matches your opening parenthesis (see your line 10).
Use lower case for variable names, ie: name instead of Name, age instead of Age and so on.
Use 4 spaces (not tabs) for indentation.
Remember that input() will return a string, if you are looking for a number use something like int(input()), so this line:
Age = input ("Now " + Name + " What is your age? Now I must ask you enter this in numbers otherwise I will get confused")
would look like this:
age = int(input("Now " + Name + " What is your age? Now I must ask you enter this in numbers otherwise I will get confused"))
and would be much neater if you use formatting:
age = int(input("Now, {} what is your age? Now I must ask you enter this in numbers otherwise I will get confused".format(name)))
The same would be true for your print functions:
print("Ahh, hello {}".format(name))
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply


Messages In This Thread
problem with syntax error - by jobemorgan - Jul-26-2017, 06:36 PM
RE: problem with syntax error - by sparkz_alot - Jul-26-2017, 06:45 PM
RE: problem with syntax error - by sparkz_alot - Jul-26-2017, 07:16 PM
RE: problem with syntax error - by Larz60+ - Jul-26-2017, 08:02 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  is this really a syntax error? Skaperen 4 468 May-25-2024, 07:31 AM
Last Post: snippsat
  World Clock syntax error OscarBoots 1 358 May-03-2024, 05:20 AM
Last Post: snippsat
  Syntax error for "root = Tk()" dlwaddel 15 1,897 Jan-29-2024, 12:07 AM
Last Post: dlwaddel
Photo SYNTAX ERROR Yannko 3 593 Jan-19-2024, 01:20 PM
Last Post: rob101
  Syntax error while executing the Python code in Linux DivAsh 8 2,096 Jul-19-2023, 06:27 PM
Last Post: Lahearle
  Code is returning the incorrect values. syntax error 007sonic 6 1,514 Jun-19-2023, 03:35 AM
Last Post: 007sonic
  syntax error question - string mgallotti 5 1,539 Feb-03-2023, 05:10 PM
Last Post: mgallotti
  Python Pandas Syntax problem? Wrong Output, any ideas? Gbuoy 2 1,049 Jan-18-2023, 10:02 PM
Last Post: snippsat
  Syntax error? I don't see it KenHorse 4 1,485 Jan-15-2023, 07:49 PM
Last Post: Gribouillis
  Syntax error tibbj001 2 1,073 Dec-05-2022, 06:38 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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