Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python 3 crash course
#1
i have made this code

first_name = "ada"
last_name = "lovelace"
full_name = f"{first_name} {last_name}"
print(f"Hello, {full_name.title()}!")
this is the mistake it makes

ada lovelace

Process finished with exit code 0
Reply
#2
Hi

i Ran your code and got the output
Output:
Hello, Ada Lovelace!
what is the output you are expecting ?
Reply
#3
That was the result i was looking for. sp why does it say

ada lovelace

Process finished with exit code 0

in my pycharm

(Aug-25-2019, 06:11 PM)Yoriz Wrote: Hi i Ran your code and got the output
Output:
Hello, Ada Lovelace!
what is the output you are expecting ?
BTW sorry for the double posting. It just thought it didnt post. so i pressed twice but it did. hope you want kick me out.


i looked on google and found this

https://intellij-support.jetbrains.com/h...g-python-3

pycharm has problems with f format apprently. how did you run it. i tried idle and got a wierd error
)
SyntaxError: multiple statements found while compiling a single statement

maybe i will try sublime text free version
Reply
#4
I used VS Code.
The error
Error:
SyntaxError: multiple statements found while compiling a single statement
is because you tried to paste all the code into the python idle shell and it didn't like it.

pasting it into the command line worked ok
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> first_name = "ada"
>>> last_name = "lovelace"
>>> full_name = f"{first_name} {last_name}"
>>> print(f"Hello, {full_name.title()}!")
Hello, Ada Lovelace!
>>>
Reply
#5
Are you using Windows?
The basic here Python 3.6/3.7 and pip installation under Windows.
If using PyCharm you most configure it to use Python 3, Configure a Python interpreter.

james_newbie Wrote:maybe i will try sublime text free version
A better option is VS Code from start

It's must that python and pip is configure right(on all OS Windows,Linux or Mac) from command line.
E:\div_code
λ python -V
Python 3.7.3

# look at code
E:\div_code
λ cat lovelace.py
first_name = "ada"
last_name = "lovelace"
full_name = f"{first_name} {last_name}"
print(f"Hello, {full_name.title()}!")

# Run code
E:\div_code
λ python lovelace.py
Hello, Ada Lovelace!
I am using cmder here as cmd/powershell is a nightmare Evil
Reply
#6
(Aug-25-2019, 07:18 PM)snippsat Wrote: Are you using Windows? The basic here Python 3.6/3.7 and pip installation under Windows. If using PyCharm you most configure it to use Python 3, Configure a Python interpreter.
james_newbie Wrote:maybe i will try sublime text free version
A better option is VS Code from start It's must that python and pip is configure right(on all OS Windows,Linux or Mac) from command line.
 E:\div_code λ python -V Python 3.7.3 # look at code E:\div_code λ cat lovelace.py first_name = "ada" last_name = "lovelace" full_name = f"{first_name} {last_name}" print(f"Hello, {full_name.title()}!") # Run code E:\div_code λ python lovelace.py Hello, Ada Lovelace!
I am using cmder here as cmd/powershell is a nightmare Evil



im using mac i try to setup sublime text. what is the other i dont know what pip is. i am complete newbie.
it says 3.7 in interpretur but can+t take f format. but f format should be ok in above 3.6 and i should hae 3.7

the book i use uses sublime text.

(Aug-25-2019, 07:37 PM)james_newbie Wrote:
(Aug-25-2019, 07:18 PM)snippsat Wrote: Are you using Windows? The basic here Python 3.6/3.7 and pip installation under Windows. If using PyCharm you most configure it to use Python 3, Configure a Python interpreter.
james_newbie Wrote:maybe i will try sublime text free version
A better option is VS Code from start It's must that python and pip is configure right(on all OS Windows,Linux or Mac) from command line.
 E:\div_code λ python -V Python 3.7.3 # look at code E:\div_code λ cat lovelace.py first_name = "ada" last_name = "lovelace" full_name = f"{first_name} {last_name}" print(f"Hello, {full_name.title()}!") # Run code E:\div_code λ python lovelace.py Hello, Ada Lovelace!
I am using cmder here as cmd/powershell is a nightmare Evil
im using mac i try to setup sublime text. what is the other i dont know what pip is. i am complete newbie. it says 3.7 in interpretur but can+t take f format. but f format should be ok in above 3.6 and i should hae 3.7 the book i use uses sublime text.


i made it work. set up python 3.7 in terminal and then get the right build in sublime text.
i dont know how to make box brackets on a mac. can i use curly or normal for code.

i have to relearn my html for the quistions.
Reply
#7
(Aug-25-2019, 07:37 PM)james_newbie Wrote: im using mac i try to setup sublime text.
Installing Python 3 on Mac OS X or a better altentive in my view pyenv Simple Python Version Management | build environment Mac.

Quote:what is the other i dont know what pip is
pip is one of the most important part of Python,it's dos package management.
So we have PyPi using a package eg Requests pip install requests.
This download and install automatic for you.

Quote:the book i use uses sublime text.
This dos not all mean that you need to use sublime text,VS Code is more geared against at Python and a better free option in my view.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Catching a crash within a library code ebolisa 9 3,060 Nov-22-2021, 11:02 AM
Last Post: bowlofred
  Python Crash Course ( 2nd edition) alok 1 1,844 Jul-19-2021, 05:55 PM
Last Post: snippsat
  Embedding python cause crash when use boost::asio multi threading udvatt108 0 1,694 Oct-04-2020, 03:15 PM
Last Post: udvatt108
  Im using python crash course version 2 james_newbie 3 2,345 Sep-07-2019, 09:21 PM
Last Post: ichabod801
  Pyinstaller exe won't launch after crash kainev 0 2,584 May-11-2019, 06:06 PM
Last Post: kainev
  python kernell crash with a ctypes program Jstechg 1 3,451 Nov-24-2018, 02:37 PM
Last Post: Jstechg
  Py_Initialize Crash with Python 3.6 paulhbm 0 4,357 Sep-20-2018, 09:56 AM
Last Post: paulhbm
  IDLE crash using special characters? reikonaga 6 4,669 Aug-06-2018, 07:37 AM
Last Post: keegan_010
  How to Crash a Computer keegan_010 6 4,183 Aug-05-2018, 06:01 AM
Last Post: Skaperen
  Console crash after boot. friendlymegalomaniac 1 2,553 Apr-07-2018, 05:44 PM
Last Post: wavic

Forum Jump:

User Panel Messages

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