#Currency Converter in Python
1 messages · Page 1 of 1 (latest)
What's the point of using sqrthere?
Have you read the task on the left?
Yes
I did everything correctly
Besides one thing
I square rooted but I don’t think I am supposed to because I got an different answer
They got 89.6 and I got 5607.97
@stable temple Please use descriptive thread titles. Also, you don't need to create a new thread for every question you have
Have you read this
Where does it mention square roots
Oh this is cool
It doesnt
But I assumed it was square root because my last question was square root
Which was this
Please read this again
Also this
!format python
I’m new to coding so I don’t really understand what the article is saying
Please use code blocks for small pieces of code, and screenshot the instructions
Reading a photo of a screen is very difficult
The exercise task is not related to coding
Okay I will take note
You have X in currency Y
Make thing that asks the user how much he has
Google current exchange rate
Calculate value of shit currency in USD
Yeah not anymore that I broke it down
Currency Converter in Python
the exchange rate from Imperial Drachma to USD is to take the square root
Central bankers working night shifts for that one
How do I google the exchange rates
How old are you?
Serious question
how do you think this might be attempted
hard work
Colombian pesos exchange rate ?
.
have you never used a search engine before?
My bad, they don’t teach us about exchange rates in school, so I’m not sure how I would search it
Do they teach you about reading in school?
Yes
the same way you search for literally anything else on google. you put in the thing you want to know about
well what does the website say
we aren't going to do the reading or the thinking for you
I’m making sure I’m correct before I move on to the next step
to do what?
Because back to the problem , it says what do you have left in pesos , and they say 5600
I'm not able to read the problem, you've only pasted it as a small image
how would typing 5600 into google help you do that
I don’t know that’s why I’m asking for help😭
think first
I did and that got me no where
figure out what you need to do before you try to do it
X * Y = Z
X = USD amount
Y = how many usd for each Z
Z = shit currency amount
we will not be a wall for you to throw guesses at and see what sticks
solve for X
This makes more sense , thank you
so do i divide x by y?
to get z
jfc have you ever taken a math class
x=1.43
y=5600
(columbian pesos)
wait
y=3916
my bad i didnt get it at first i get it now
$1 for each 3917 in pesos
and $1.43 for each 5600 pesos
now that i got that what do i do next ? @obtuse salmon
Nevermind I look slow now 🤦♂️ but I got the answer now I have to convert the foreign currency’s to usd dollar
😎
But why did I get an error
i entered 1.43 because thats what it is in usd
but it didnt go through
and i know im correct because i wrriten the problem down paper but im off by 3 but its because the currency value couldve changed since they made this website
i got 86.26 on paper and they got 89.6
but when i plug it in on computer i get error idk why
Why not try it
You will limit your learning if you're afraid to experiment yourself. You cannot always be asking people to hold your hand while you code
Okay thx for the advice , I’m going to try
worked right?
Yes it worked
But I had to add =float behind (input
That means you learnt something!
Yeah I had some notes written down earlier I just went back to it remembered float means a decimal number
not the exact same answer but close enough!
Wait what?
The currency value changed in usd since this website came out
That’s why it’s not the same answer
@rough totem
Your code doesnt even do the conversion tho
?????
Your program is supposed to do that
Otherwise all you've done is created an addition calculator
It says google the exchange rate
😐
So what did I do wrong
Your program needs to do the conversion for the user
No it isn’t
it is according to what u said
It says calculate the “total” in USD
Create a
currency.pyprogram that [...] and calculates the total in USD.
I might be wrong
You are wrong
then you have to use fetch/requests from the current currency
What’s fetch request
You just do the conversions you're doing on paper, using code
But they don't need to do a request to any website or api
It's supposed to be a simple beginner exercise
So I code , 5600 pesos=(int)1.43?
????
I wonder if you think things through
I do its I’m just overwhelmed by a lot of this stuff because this is kind of my first day trying to code myself
Yesterday was just me taking notes
0.0026
So you’re saying can I convert 10usd to pesos in python ?
10 pesos to usd
How would you do it if I told you something is worth $10 and I have 5 of them. What's the total value that I have?
yes
so you would do the same in python
pesos are worth 0.00025 usd and I have 10 of them
0.0025?
yes but how would you write the code in python to calculate it for you
10 *0.00025
yup
Now, what if I told you I have 15, 25, 67, 123? or an n number of pesos? where n is the input by the user. How would you calculate it?
N is the variable right ?
n*
I’m sorry I’m confused
I don’t think codedex taught me how to do that yet
@simple zenith
yes
I don’t know how to calculate it , I might I just don’t understand in this method
n * 0.00025
So what do I do with 15 , 35, 67 , 123?
n is any number of pesos. it can be 15, 35, 67, 123 or whatever the user enters
Do you get how to do it now?
No I’m confused still but I got the answer because I got frustrated and looked at the solution
total = pesos * 0.00025 + soles * 0.28 reais * 0.21
But I don’t get where they got that from
got what from?
Do you understand the problem?
Mostly
what is it asking you to do?
It’s asking me to create a program that ask the user for the amount they have in pesos , soles , and reais and the calculated the total in usd
yes so the numbers that you see in that line are the conversion rates
Ohhhh
See I get it now , I just didn’t know why I was typing that in
but i got the wrong answer
Never mind
Got it
@simple zenith I have one last question
Where did I get 0.00025 , 0.28 , 0.21 from ?
I didn't tell you to square root for this problem....
The last problem you did was to calculate hypotenuse using a formula which contained square root. You used square root because that's part of the formula to calculate the hypotenuse.
This problem is for currency conversion, which is a different problem.
You have to think about the problem you are trying to solve - don't just use square root because it solved the last problem - think about WHY you used it in the last problem. Think about what math is involved in THIS problem.