For today's coding challenge, you'll get a string for a coffee order. You'll need to identify any menu items and return a formatted order. Check it out on the freeCodeCamp mobile app.
@FTPfbd@MORTHIndia I have been receiving SMS regarding traffic challan, each time for different vehicle number. Plz check your system & update. I neither live in Faridabad nor have a vehicle.
@FTPfbd@MORTHIndia Dear Sir/Madam, received one more SMS couple of minutes back regarding challan. Please check what is wrong with the system and fix it.
@4EverPrem@MORTHIndia The issue has been noted and forwarded to the concerned branch for necessary action. The system will be checked and corrected accordingly.
Regards,
Faridabad Traffic Police
@FTPfbd@MORTHIndia Dear Sir/Madam, whole point of raising this issue is that I do not have any vehicle, still getting these SMS, each time with different vehicle number. Seems like your system has a glitch. Plz have it corrected 🙏
@4EverPrem@MORTHIndia Thank you for bringing this to our notice. Kindly share your vehicle number, challan number and supporting details so the issue can be verified. You may also email your grievance at dcptraffic.fbd-hry@nic.in. Appropriate action will be taken after examination.
@Python_Dv Error.
num is a local variable and exists only in the function fun1, therefore, when it is called outside the function, it will result in error.
@clcoding None. append method adds element at the end of the list but returns None.
Below code will print [1, 2, 3, 4]
a = [1,2,3]
a.append(4)
print(a)
@Python_Dv No output. When 7 is divided by 2, the remainder is 1 and not 0, therefore, the if clause is not met. As a result, none of the print statements are executed. Mind it None is a keyword in Python so None is not the correct answer.
@clcoding [-2, -1, 1, 2]
Although not explicitly specified, filter will keep only those values from the nums list which are truthy in nature and filter out falsy values. Zeros are falsy and non-zeros truthy so it outputs [-2, -1, 1, 2]
Comment your answer below!
Think you know Python inside out? 🐍 Test your coding skills with these tricky Python output questions! Can you crack this code? Let’s find out!
@clcoding 1 2
if the code is
t = ((1,2),(3,4),(5,6))
for a, b in t:
print(a, b)
It prints
1 2
3 4
5 6
clearly, a is first element and b is second element of each individual tuple in t.
Coming back to code in question, in 2nd iteration, a = 3 so loop breaks out and printing 1 2
@clcoding 1 5
When t is instantiated, t.f is pointing to method f.
t.f() -> method f is called -> self.f = 5 assigns 5 to f but return 1 overwrites it with 1. So t.f() = 1
t.f -> Now t.f is no longer a method after it and as previously is re-assigned to 5, so t.f = 5
@PythonPr 5. Python passes values to a variable by object reference. Since y is int, it is immutable, therefore, y is a new object different from x and allocated different memory. Therefore, changes in x does not impact y.