RE: Variables And Numeric Data Types In Python

avatar

You are viewing a single comment's thread:

I love that Python is so flexible, but you do need to watch out for the types of your variables. I have played around with things like prime numbers and it it helps that integers can be as long as you like. In out languages they tend to be limited.

I fairly recent feature I like is 'f' strings so you can simplify

print("My cats name is {} and he is {} years old".format(cats_name, cats_age))

to

print(f"My cats name is {cats_name} and he is {cats_age} years old")


0
0
0.000
2 comments
avatar

Thanks for that @steevc . My goal this year is to be 100% proficient with Python and be confident in calling myself a Python programmer. So any suggestions you have I will take on and f string are something I have seen and will have to do an indepth post on.
Thanks again.

0
0
0.000
avatar

I'm doing some Python for work, so I keep picking up things. I expect posts on lists and other collections are planned by you.

0
0
0.000