Ask coding questions

← Back to all posts
Please read below for info
Jehireal2 (0)

How do I connect this like
(prefix'hello')
I want the prefix to connect with the hello message but the prefix will turn into a "!" instead of prefix

Comments
hotnewtop
CodeMaster007 (109)

Is this related to coding or some word choice thing? If this is related to coding, then what language? Can you give some more information. I'm not sure I understand.

CodeMaster007 (109)

Ok. To say hello, you say... @Jehireal2

print("Hello")

Jehireal2 (0)

@CodeMaster007 not that I meant like I have a prefix correct then I have a message correct then I'm gonna say !hello in discord and it should reply with Hello but I want the prefix to be a variable so I don't have to change every commands prefix

CodeMaster007 (109)

What do you mean by prefix? @Jehireal2

Jehireal2 (0)

@CodeMaster007 by prefix I mean like
prefix = "!"

CodeMaster007 (109)

ok. So you just include it with the print? @Jehireal2

print("Hello World!")

if you just want the "!", you do

print("!")

Jehireal2 (0)

@CodeMaster007 I figured it out myself it was f"{prefix}hello"

CodeMaster007 (109)

Nice! Glad you figured it out! @Jehireal2