7
submitted 1 month ago* (last edited 1 month ago) by EveryMuffinIsNowEncrypted@lemmy.blahaj.zone to c/python@programming.dev

I'm currently doing Dr. Charles Severence's lessons on FreeCodeCamp to try to learn Python3. I'm on lesson exercise 02_03 and confused about multiplying floating-point and integer values.

The goal is to write a Python program multiplying hours worked by pay rate to come up with a pay quantity.

This is the code I wrote:

h = input("Enter hours: ")
r = input("Enter pay rate: ")
p = float(h) * r

I got a traceback error, and the video said the correct way to solve said error was change Line 3 from p = float(h) * r to p = float(h) * float(r).

However, what I'm confused about is why would I need to change r to a floating-point value when it's already a floating-point value (since it'd be a currency value like 5.00 or something once I typed it in per the input() command*?

What am I missing here?

 


*I can't remember: are the individual commands in a python line called "commands"?

 

 


Edit: Wrote plus signs in my post here instead of asterisks. Fixed.

 


EDIT: Thanks to @Labna@lemmy.world and @woop_woop@lemmy.world. I thought that the input() function was a string until the end-user types something in upon being prompted, and then becomes a floating-point value or integer value (or stays a string) according to what was typed.

This is incorrect: the value is a string regardless of what is typed unless it is then converted to another type.

I just want you to know how much I appreciate the fact that you typed out the list of repos mentioned in the video, since you know many people are not going to watch the video but still want the information.

I mean this. Thank you. You are awesome and deserve cake.

28
submitted 1 month ago* (last edited 2 weeks ago) by EveryMuffinIsNowEncrypted@lemmy.blahaj.zone to c/privacy@lemmy.ml

Follow-Up: It's going great! I've stopped using my Tile tracker, I haven't lost my keys (yet), and I feel like I'm a LOT less trapped by my circumstances regarding them. Many thanks everyone! Many thanks indeed!


 

(See bottom for tl;dr.)

I'm the kind of person who loses their keys easily, so I love the idea of trackers: little devices that you can attach to your wallet, phone, or keyring that connect via bluetooth to an app on your phone to help you find it.

Problem is pretty much all the options I can find are run by companies with shitty privacy policies: Tile, Apple AirTag, Chipolo, and so forth.

  • Tile collects shitloads of data and is partnered with Amazon to boot;
  • Apple Airtags AFAIK only work with Apple devices, and besides it's Apple so no thank you; and
  • Chipolo also collects shitloads of data and shares information with data brokers and data collection companies of all stripes. No thank you.

In any case, I really don't need a location network larger than maybe 200 meters (about 650 feet). If I lose my keys, odds are it's either in my car or in my house, and my house is like 100 square meters (about 1000 square feet). So Bluetooth is really all I need. I don't even need to see it on a map; I just need for it to ding or something.

I'm currently using Tile but I really want to get away from it. Worst case scenario, I'll stop using the Tile, but I really am a forgetful little shit. Lol.

 

tl;dr – Looking for recommendations for ideally short-range Bluetooth trackers for keys, with decent privacy. Max required range = 200 m (650 ft). Also, pie tastes great. Cheers.

 


Edit: Added a single comma (because fuck syntactic ambiguity) and added follow-up. :)

[-] EveryMuffinIsNowEncrypted@lemmy.blahaj.zone 60 points 2 months ago* (last edited 2 months ago)

Honestly? It was kind of shitty back then and is just as shitty nowadays.

I mean, I get why people do it. But in my honest opinion, it's still a blatant violation of that person's dignity, at least if it's distributed.

43

I'm currently learning Python and am learning about very basic functions such as int(), float(), and input().

I have the first two down pat, but I'm struggling to understand the last. The example I'm looking at is found at 12:26 of this video:

nam = input('Who are you? ')
print('Welcome', nam)

Who are you? Chuck
Welcome Chuck

In this case, wouldn't nam be a variable equal to the text on the right side of the = sign?

In which case, if nam is equal to input('Who are you? '), then wouldn't print('Welcome', nam) just result in

Welcome input(Who are you? )?

Obviously not (nor does it work in a compiler), which leads me to believe I'm clearly misunderstanding something. But I've rewatched that section of the video several times, and looked it up elsewhere on the web, and I just can't wrap my head around it.

Could someone help me with this?

Thanks.

Modern corporations are a damned plague. Most of these fuckers would destroy our whole cultural heritage in a heartbeat if it meant making a profit.

Yes, corporations exist to make profit, but come on, there are limits.

83

I'm currently learning how to code (currently Python, then maybe JavaScript), but I'm not always around my desktop, and learning on my phone is not always an option (also, it can be quite cumbersome at times). Therefore, I'm looking into purchasing a laptop just for learning how to code and stuff.

I don't want to get a Chromebook because I want to be able to wipe the drive and install Linux on it (probably Linux Mint). Maybe it's changed since 2013, but the last time I had a Chromebook, it was a pain in the ass to install even bog-standard Ubuntu on it.

Problem is, I'm also heavily limited by space & budget: no more than 11 in (280 mm) total laptop width and 330 USD base price.

Does anyone have any suggestions?

Please forgive me if this is not the right space for this kind of question. Lemme know if it is and I'll delete it. :)

A new theory claims

Hypothesis, not theory. It is a small distinction but an important one in science.

I think it's kind of an unfair comparison. Hubble was made decades before Webb was, when we knew a lot less than we do now.

This is like insulting Shakespeare for not writing with a ballpoint pen.

What a fucking idiot.

I think it's really dumb that people think 5'7" (170 cm) is short for males.

The typical height of the human male is anywhere from 5'5"–6'0" (165–183 cm).

5'7" isn't short; it is stupidly average.

Source: https://www.healthline.com/health/average-height-for-men

20
submitted 8 months ago* (last edited 8 months ago) by EveryMuffinIsNowEncrypted@lemmy.blahaj.zone to c/lemmy@lemmy.ml

Hello.

I'm extremely tired, so it very well could be that this is extremely simple and I'm just not getting it. However, what I would like to know is how to open a post from a community on one instance on another instance.

For example, here's a recent post from !asklemmy@lemmy.ml. I know that to open that community in the instance lemmy.blahaj.zone, I would merely type into the address bar

lemmy.blahaj.zone/c/asklemmy@lemmy.ml

However, how would I open that particular post in that community on the latter instance? Is it even possible?

Cheers.

 

P.S.

I did do some searching on both this community as well as the Reddit Lemmy FAQ page but I didn't find anything. However, I could've missed something. If it's something obvious, I apologize in advance.


Edit: Assuming I understand what people are saying, well, evidently, it seems to be a current limitation of the ActivityPub protocol. Perhaps that will change one day. Hopefully soon. ¯\_(ツ)_/¯

Counterpoint:

Epic Games Store

Yeah I was gonna say. Not nearly as bad as public companies. I'd take private companies any fucking day of the week over those soulless bastards.

232
submitted 11 months ago* (last edited 11 months ago) by EveryMuffinIsNowEncrypted@lemmy.blahaj.zone to c/lemmyshitpost@lemmy.world

Hell, I'm so socially inept that I interacted with girls in the past and then as they were leaving I was told that I did well at flirting with them, to which I responded with, "I was flirting?"

[-] EveryMuffinIsNowEncrypted@lemmy.blahaj.zone 81 points 1 year ago* (last edited 1 year ago)

I don't see the contradiction here. Right Person is just asking what Left Person's beliefs on those matters are, not whether they believe those beliefs are objective.

3

I'm well aware that I can rip most Blu-rays with MakeMKV and then convert to mp4 with Handbrake; however, the former just rips everything raw from the disk so the file size is humongous and the conversion via Handbrake for just a single file is terribly long and puts a lot of strain on my computer.

I've heard that EaseFab LosslessCopy is decent, but they only have a Windows and a Mac version, and I'm unsure how well it'd run under Wine.

I am willing to pay for it, but only as long as it's not a subscription thing. Has to be a one-time payment.

Does anyone know any decent Blu-ray ripping software that fits these conditions and run well on Linux? Specifically, it would be either Pop!_OS or Linux Mint. (I'm still using Windows because I want to figure out some software alternatives before I do so I'm not caught with my pants down, so to speak.)

view more: next ›

EveryMuffinIsNowEncrypted

joined 1 year ago