Python Forum
(Complete Novice) Code not working
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
(Complete Novice) Code not working
#8
you need to write it in the cmd window or terminal, or wherever you execute the script, i.e. where it prints What is your name?
These are 2 different examples.
In first example you have 2 names (variables) - name and surname and then you print them.
In the second part of the example you take input from user and assign it value to name name. Then it use this new value (or same value if you enter David) when it print the greeting. Note that it again uses input as noted by @ndc85430, i.e. you need to press a key in order to finish the execution of the script
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
(Complete Novice) Code not working - by PythonGainz - Mar-21-2020, 05:15 PM
RE: (Complete Novice) Code not working - by buran - Mar-21-2020, 05:23 PM
RE: (Complete Novice) Code not working - by buran - Mar-21-2020, 05:19 PM
RE: (Complete Novice) Code not working - by buran - Mar-21-2020, 05:24 PM
RE: (Complete Novice) Code not working - by buran - Mar-21-2020, 05:32 PM
RE: (Complete Novice) Code not working - by buran - Mar-21-2020, 05:53 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  New to Python - Not sure why this code isn't working - Any help appreciated TheGreatNinx 4 1,101 Jul-22-2023, 10:21 PM
Last Post: Pedroski55
  code not working when executed from flask app ThomasDC 1 1,090 Jul-18-2023, 07:16 AM
Last Post: ThomasDC
  I am new to python and Could someone please explain how this below code is working? kartheekdas 2 1,132 Dec-19-2022, 05:24 PM
Last Post: kartheekdas
Exclamation My code is not working as I expected and I don't know why! Marinho 4 1,195 Oct-13-2022, 08:09 PM
Last Post: deanhystad
  My Code isn't working... End3r 4 2,093 Mar-21-2022, 10:12 AM
Last Post: End3r
  [Solved] Novice question to OOP: can a method of class A access attributes of class B BigMan 1 1,403 Mar-14-2022, 11:21 PM
Last Post: deanhystad
  I don't undestand why my code isn't working. RuyCab 2 2,074 Jun-17-2021, 03:06 PM
Last Post: RuyCab
  code is not working , can anybody help? RandomPerson69 4 3,049 Mar-22-2021, 04:24 PM
Last Post: deanhystad
  Short code for EventGhost not working Patricia 8 3,894 Feb-09-2021, 07:49 PM
Last Post: Patricia
  Code no longer working yk303 14 10,625 Dec-21-2020, 10:58 PM
Last Post: bowlofred

Forum Jump:

User Panel Messages

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