#π Need help about the string thing
63 messages Β· Page 1 of 1 (latest)
@tropic elbow
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
This still shows up
your syntax isn't quite right here. you need to assign variables using =, not :
Ok
This still shows up
show the latest code
print("Welcome to the RD Bank")
Name=input("Enter your full name:")
Loan=input("How much loan would you like to take(The number of your loan should have at least 3 d.p):")
print(f"Hello {Name} your loan of
{Loan} is due on 09/08/24" )
It's because you have written last print in two different lines, don't give new line after "loan of"
python variables are single-line, you can't press enter while writing them. Instead you put a new line character: \n
But thx
Alright
I appreciate all of yβallβs help
So like that:py print("Welcome to the RD Bank") Name=input("Enter your full name:") Loan=input("How much loan would you like to take(The number of your loan should have at least 3 d.p):") print(f"Hello {Name} your loan of\n{Loan} is due on 09/08/24")
No problem!
Okay
Now this shows up
What version of python do you have?
Let me check
import sys
print(sys.version_info)
you can run this in a file to easily check
That's not python's version, latest python is 3.12
Follow this advice, works everywhere
that's not a good sign, haha
this app seems, let's just say, not great
The error above then is likely because you're using an older version of python that doesn't support f-string
It does support f-string
yeah, that would be very old
you can use str.format instead
I used it multiple times
pre 3.6 I believe?
Can you show us the latest code you're running then
Show us the code that was erroring
Btw if I suddenly stop responding then that means my power went out
Oh ok
print("Welcome to the RD Bank")
Name=input("Enter your full name:")
Loan=input("How much loan would you like to take(The number of your loan should have at least 3 d.p):")
print(f"Hello {Name} your loan of \n{Loan:.2f} is due on 09/08/24" )
Hey @tropic elbow!
It looks like you're trying to paste code into this channel.
Discord has support for Markdown, which allows you to post code with full syntax highlighting. Please use these whenever you paste code, as this helps improve the legibility and makes it easier for us to help you.
To do this, use the following method:
```py
print('Hello, world!')
```
This will result in the following:
print('Hello, world!')```
You can **edit your original message** to correct your code block.
Ok
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.