0

Why these outputs?

franco = print(“help”) >>help franco >> print(franco) >>None

6th Jul 2024, 8:38 AM
Giovanni Paolo Balestriere
Giovanni Paolo Balestriere - avatar
8 Respuestas
+ 5
franco = print("help") What was your idea? print() function does not return anything. There is no point in assigning print() to <franco> variable. I don't even have an idea what you meant to do with the rest of it. Can you be a little bit more descriptive about your intention? clear message gets better replies...
6th Jul 2024, 9:17 AM
Ipang
+ 4
Were you trying to assign franco to become a callable function that prints "help" whenever you use it? Try this: franco = lambda: print("help") franco() franco() franco() Output: help help help
6th Jul 2024, 2:22 PM
Brian
Brian - avatar
+ 3
Spam from martina Gifens reported.
7th Jul 2024, 9:47 PM
Brian
Brian - avatar
+ 2
In the first line you do two things. 1. You call the print function with "help" as given parameter. So the output is help. 2. You assign the return value of the print function to franco. Which is None. In the second line you write franco. If you just write a variable nothing happens. In the third line you call the print function again. This time franco is given. So the result is the String representation of None. Try help(print) to get more information about this function 😉
6th Jul 2024, 1:15 PM
Stefanoo
Stefanoo - avatar
+ 2
The print function doesn't return a value, so franco get set to None. Actually franco has always been None in your code.
8th Jul 2024, 7:30 AM
Rick Shiffman
Rick Shiffman - avatar
+ 1
I think the issue is that you are trying to assign a value for that print function which I don't think is possible, cause the key 'help' has already been ordered to print amd does not belong to any value. And for the last output, u tried printing 'franco' thinking it might give you help, but the thing is that u are trying tp create another input with no output. Rather do this: franco = “help" franco >>>help OR print(“help") >>>help
6th Jul 2024, 11:14 PM
Collins Mbagwu
Collins Mbagwu - avatar
0
The print function returns None by default On the first line, you assigned that to variable franco Which is why when you printed it, you got None
7th Jul 2024, 12:16 AM
🦄🦄🦄
🦄🦄🦄 - avatar
0
I've used Grademiners multiple times, and I can confirm that they are safe. The quality of their work is excellent, and they always deliver on time https://www.linkedin.com/pulse/grabmyessaycom-review-worth-your-trust-siyani-cappucci-4uwae Their customer support is responsive and helpful. I've never had any issues with plagiarism or security. Highly recommend for anyone needing reliable academic assistance.
7th Jul 2024, 9:18 PM
martina Gifens
martina Gifens - avatar