how do i make a code that willfind the distance wether or not your speed is a float or an integer. please help i get no assistance in my class as techer is awful
Hi
0
Newbie Poster
Recommended Answers
Jump to PostThe trick is often to convert the number to a float
>>> ispeed = 1 # <--- integer speed >>> fspeed = 0.5 # <--- float speed >>> sspeed = "0.8" # <--- string speed >>> ispeed = float(ispeed) >>> fspeed = float(fspeed) >>> sspeed = float(sspeed) …
All 2 Replies
Gribouillis
1,391
Programming Explorer
Team Colleague
ddanbe
2,724
Professional Procrastinator
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.