#๐Ÿ”’ my python assignment

113 messages ยท Page 1 of 1 (latest)

hybrid wind
#

I have 10 tasks i need help with.. im new to python all i learnt was loop and couple of stuff. def and input and int(input.. i could really use help since i really dont want to fail my course

spiral forgeBOT
#

@hybrid wind

Python help channel opened

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.

hybrid wind
#

i could really use help guys

still shoal
#

be patient

#

try looking up the solution or figuring it out yourself while you wait and you'll thrive.

#

Just a tip pithink

solar kindle
#

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

hybrid wind
hybrid wind
still shoal
hybrid wind
#

whats a string?

#

whats the output supposed to be

solar kindle
#

"MMCIX" would also be a string

hybrid wind
#

so whats the output

solar kindle
#

it says at the bottom

hybrid wind
#

oh i get it

#

should i try and show youy

still shoal
#

but rarely comes up

hybrid wind
#

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

still shoal
#

you can and did

hybrid wind
#

alrighty

#

can you explain the question and tell me what i need to do

still shoal
#

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.incident_actioned

hybrid wind
#

when will you be done?

#

when do you assume

still shoal
#

1 or 2 h

vocal ledge
#

hey don't mean to butt in but I felt like tying this out and got a solution using this code

spiral forgeBOT
#

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.
vocal ledge
#

'''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

hybrid wind
#

@vocal ledge

#

is this the code?

vocal ledge
#

yeah this is the code

hybrid wind
#

you made this?

#

honestly

vocal ledge
#

yeah i just made it

hybrid wind
#

what is dec_equivia

#

what is elif all

#

i didnt study that

#

sadly i cant use stuff i didnt study ;-;

vocal ledge
#

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

hybrid wind
#

im so confuseddd

vocal ledge
#

my bad im trying to add comments to the code right now to make it easier for you to read

hybrid wind
#

okayyy

#

it would be great if you do that

#

any update?

vocal ledge
hybrid wind
#

one sec

#

this is the assignment folder

#

one sec

#

i think they are related

#

@still shoal @vocal ledge

hybrid wind
still shoal
hybrid wind
#

not a test. an assignment

#

last time i tried AI and i failed so i want to learn how to write it

still shoal
#

ohh okay we can start with 10 and work backwards

#

(10 was the first I read=

#

why I'm doing it first

hybrid wind
#

the guy made me this code

#

i hope its not AI generated i cant risk failing anymore.

vocal ledge
#

its not ai๐Ÿ˜ญ

still shoal
#

!paste

spiral forgeBOT
#
Pasting large amounts of code

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.

hybrid wind
still shoal
#

easier to read, change and show what you've tried with than google docs

hybrid wind
#

thats why

hybrid wind
vocal ledge
still shoal
vocal ledge
#

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

still shoal
hybrid wind
#

no not yet

still shoal
# hybrid wind 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."

still shoal
hybrid wind
#

ookay one second

#

can we call?"

still shoal
hybrid wind
#

as long as you can text its fine

#

one second

still shoal
#

A question nobody asks yeet people should and I will, is when is your deadline?

hybrid wind
#

can you hear me

hybrid wind
#

but for me

#

its tomorrow

#

bc i also got an exam

#

can ya hear me

still shoal
#

!paste

spiral forgeBOT
#
Pasting large amounts of code

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.

spiral forgeBOT
#
Python help channel closed

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.