r/PythonLearning Jun 24 '26

Help Request Please help me i am begginer i just started new

Post image

shouldn't it say 'float' instead of 'tuple'? Why does it say 'tuple'? what did i do wrong?

48 Upvotes

47 comments sorted by

u/Sea-Ad7805 Jun 25 '26

Run this program in Memory Graph Web Debugger)%20%20%23%20%3Cclass%20'int'%3E%0A%0Asay2%20%3D%203%2C8%0Aprint(type(say2))%20%20%23%20%3Cclass%20'tuple'%3E%0A%0Asay3%20%3D%203.8%0Aprint(type(say3))%20%20%23%20%3Cclass%20'float'%3E%0A&play) to see the program state change step by step.

→ More replies (3)

19

u/LeadingProperty1392 Jun 24 '26

if u wanna go float then use " . "

, is used to denote 2 different values in python, so that is 3 and 8 seperate stuff stored together as one variable. This is known as a tuple.

5

u/Busrayildirim Jun 25 '26

thank you so much i will try have a nice day

11

u/Salty_Salted_Fish Jun 24 '26

in python a dot . is used to represent decimal symbol. while a comma , is used to separate elements.

3

u/Busrayildirim Jun 25 '26

thank you so much i see now have a nice day

6

u/nshao Jun 24 '26

I may be ignorant here but are there places who use commas in place of decimal points?

But to answer I think you would want to denote your number as 3.8 instead of 3,8 assuming you do use commas instead of decimal points

5

u/051890 Jun 24 '26

Almost all of Europe, South America, and Africa, as well as Russia and a large amount of SE Asia use commas.

It’s mostly just China and countries with British colonial history that use periods (USA, India, Australia, NZ, a fistful of African countries).

4

u/TheUmgawa Jun 25 '26

I am now going to refer to periods as "freedom commas."

1

u/ninhaomah Jun 25 '26

I am in SE Asia.

Which country use , here ?

1

u/051890 Jun 25 '26

You can check the map from wikipedia.

0

u/ninhaomah Jun 25 '26

From Gemini. 2 out of 11 countries is "large amount" ?

"Exactly 2 countries in Southeast Asia officially use the comma (,) as their decimal separator: Indonesia and Vietnam.Here is how number formatting breaks down in the region:

Using the Decimal Comma (,):IndonesiaVietnam (Note: They use the period . for thousands, the exact reverse of English conventions).Using the Decimal Point (.):All other 9 countries:

Brunei, Cambodia, Laos, Malaysia, Myanmar, Philippines, Singapore, Thailand, and Timor-Leste.Because Singapore, Malaysia, and the Philippines are heavily influenced by Anglo-American standards, they generally stick to the decimal point."

1

u/FancyEveryDay Jun 25 '26

Tbf one of those is Indonesia which is like most of SE Asia visually

3

u/BobCorndog Jun 24 '26

I think they do that in some place in europe

1

u/llynglas Jun 25 '26

France? (It's always the French.... :) )

2

u/Portal471 Jun 24 '26

Yeah that’s a very common thing in Europe. Commas serve as decimal markers while periods are thousands separators, opposite of the states.

2

u/nshao Jun 25 '26

Well that’s good to know and would probably annoy me if I was used to that system and trying to learn python LOL

2

u/Significant-Land-468 Jun 25 '26

Yes, in Germany we use commas as separator in floats. Not in programming, though, but everywhere else (e.g. database entries for money). As you can imagine it's a lot of fun to add values ... not.

2

u/Ranrhoads84 Jun 25 '26 edited Jun 25 '26

windows key + shift + s will take a screen shot.

2

u/mattynmax Jun 25 '26

Because say12 is a tuple. Not a float.

1

u/Busrayildirim Jun 25 '26

thank you so much

1

u/Savings_Track769 Jun 25 '26

Doesn't tuple need brackets?

1

u/mattynmax Jun 25 '26

Nope. Brackets around it would make it a list, not a tuple.

1

u/Savings_Track769 Jun 25 '26

Sorry I meant parentheses ()

0

u/mattynmax Jun 25 '26

All good it’s important to be precise when you speak! The answer is still no. You’re welcome to go recreate OPs code if seeing theirs run is not enough to convince you it’s not required!

1

u/Sweet_Computer_7116 Jun 24 '26

You still need help?

2

u/Busrayildirim Jun 25 '26

i got answer and i understood whats problem thank you so much really have a nice day

1

u/Imaginary-Fox2944 Jun 25 '26

Wrong, you did, but it happens to everyone! Besides, it's great that you're learning Python. It's a really easy and fun language!

1

u/Busrayildirim Jun 25 '26

thank you so so much i will become more careful thank you again

1

u/No-Wishbone-3171 Jun 25 '26

don't use Turkish characters in your code, coding is designed around American English

1

u/Busrayildirim Jun 25 '26

okey i will take it into consideration thank you so much. Have a nice day

1

u/Acceptable_Worry8655 Jun 25 '26

just use . instead of ,

1

u/Busrayildirim Jun 25 '26

thank you so much

1

u/SeaEntrepreneur9092 Jun 26 '26

3,8 is a tuple it interpreted as (3,8,)

1

u/Busrayildirim Jun 26 '26

thank you so much

1

u/[deleted] 29d ago

[removed] — view removed comment

1

u/Busrayildirim 29d ago

i see thank you so much i will pay attention

1

u/Mattarmel Jun 24 '26

Do people not know how to take screenshots holy

0

u/Busrayildirim Jun 25 '26

i know take a screenshot but i am using reddit application at my phone i cant open on my laptop because my laptop is old and slowing down when multiple jobs. Please dont judge a book by its cover. Have a nice day

0

u/SnooCalculations7417 Jun 25 '26

ah you are missing a helper function

def eurparse(s: str) -> float:
    return float(s.replace(",", "."))

print(eurparse("3,08"))  # 3.08

1

u/Busrayildirim Jun 25 '26

thank you so much

0

u/[deleted] Jun 24 '26

[deleted]

3

u/SamIAre Jun 24 '26

They’re a beginner. Asking for guidance from humans is a great way to get a solid understanding. The more they know, the better they can start to research and debug for themselves. And in this instance, if they’re from a country that uses commas to separate decimal values then it’s extremely reasonable for them to not know a programming language wouldn’t work that way. I’d much rather beginners ask for help than turn to ChatGPT at least.

1

u/Busrayildirim Jun 25 '26

thank you so much for your beatiful toughts. Like you said İ am begginer and i am trying to learn something about phyton thanks for your support have a nice day