#๐ my python assignment
113 messages ยท Page 1 of 1 (latest)
@hybrid wind
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.
i could really use help guys
u must be new around here it can take seconds to hours to get help :3
be patient
try looking up the solution or figuring it out yourself while you wait and you'll thrive.
Just a tip 
show what you have made so far, and then the step you are stuck with - you know def, so you should at least have the start of a function that takes a string
oh no worries im patient! im just desperate
i dont even know how to begin.. in midterm i lost tons of marks due to not knowing how to arrange my codes
ohh best of luck to you then brave soldier, you can do this ๐
"this stuff right here", a sequence of letters essentially, just like discord messages
"MMCIX" would also be a string
so whats the output
it says at the bottom
'This also works'
but rarely comes up
no making fun of me but im literally new so
this is what i came up with
and i dont get the question
and i know i made mistakes with the spaces
@still shoal @solar kindle idk if i can ping you guys
sorry if i cant
you can and did
If I get my assignment done for the day and you still need help I will. I have this forum open simultaneously as I work on my own, so if and when I can I'll try and help if it's still needed.
1 or 2 h
hey don't mean to butt in but I felt like tying this out and got a solution using this code
Hey @vocal ledge!
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.
'''def get_string():
roman_string = ""
while True:
string = input("\nPlease enter a Roman Numerals(M,D,C,L,X,V,I)(if done type 'Done'): ").upper()
if string == "DONE":
break
elif all(num in ["M","D","C","L","X", "V","I"] for num in string):
roman_string += string
print("\nCurrent string: ",roman_string)
break
elif string not in ["M","D","C","L","X", "V","I"]:
print("\nPlease enter a correct value.")
else:
roman_string += string
print("\nCurrent string: ",roman_string)
return roman_string
def num_conversion(roman_string):
value = []
dec_equiva = 0
roman_num = {"M":1000,
"D":500,
"C":100,
"L":50,
"X":10,
"V":5,
"I":1
}
for num in roman_string:
value.append(roman_num[num])
for i in range(len(value)):
current_number = value[i]
if i + 1 < len(value):
next_number = value[i + 1]
if current_number < next_number:
dec_equiva -= current_number
elif current_number >= next_number:
dec_equiva += current_number
else:
dec_equiva += current_number
return dec_equiva
def main():
roman_string = get_string()
dec_equiva = num_conversion(roman_string)
print(dec_equiva)
main()
'''
Let me know if you have any questions or see anything I should improve on
yeah this is the code
yeah i just made it
i havent learnt some of these stuff
what is dec_equivia
what is elif all
i didnt study that
sadly i cant use stuff i didnt study ;-;
lmao lemme go over the code rq
you keep the dec_quiva because thats just a variable but replace the all statment with this "elif len(string) > 1:
print("\nPlease enter it one at a time")"
this just means that instead of typing the characters all at once you can only type them one by one
im so confuseddd
my bad im trying to add comments to the code right now to make it easier for you to read
one sec
this is the assignment folder
one sec
i think they are related
@still shoal @vocal ledge
oh mb you said 1-2 hours
was an estimation but I could help you btw are you having a test rigth now?
not a test. an assignment
last time i tried AI and i failed so i want to learn how to write it
ohh okay we can start with 10 and work backwards
(10 was the first I read=
why I'm doing it first
the guy made me this code
i hope its not AI generated i cant risk failing anymore.
its not ai๐ญ
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
oh i know its not but last assignment i got help and got 0
easier to read, change and show what you've tried with than google docs
im sorry for being scared haha
have you solved it for him?
Yeah it works
i added alot of comments to make it more easier too
i just couldn't use all() so you have to type it in one by one and it doesnt give you the individual calculations when calculating , idk if that will be a problem though
Do you understand it?
no not yet
What part of it is it that you don't understand? you do not need to explain what you do not understand, just show me what part of the code it is we can explain it better that way.
A good quote when learning coding is:" it's wrong in a million ways yeet you do not know one of them."
Do you want help in understanding it
sure but my headset is broken and this is on my school computer so the quality of my mic is literal garbage
A question nobody asks yeet people should and I will, is when is your deadline?
can you hear me
deadline is 16 december
but for me
its tomorrow
bc i also got an exam
can ya hear me
!paste
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
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.