Python Resources - Basic Python, ML, DataScience, BigData
2.41K subscribers
14 photos
3 files
243 links
You can find all kinds of resources related to Python, ML, DataScience and BigData.
Resources — »»» @python_resources_iGnani
Projects — »»» @python_projects_repository
Questions— »»» @python_interview_questions
Forum — »»» @python_programmers_club
Download Telegram
Forwarded from Python Projects
#PracticeCode: 0031
🎯 FORWARD IF YOU LIKE IT 🎯

Task:
You have to create a program in which two strings has to given as input. Now you to print True or "yes" if any one of the strings is present at the end or start of the other. Else print False or "No".

Sample Run :-

input → 'Hiabc' , 'abc'
output → True

NOTE :- It's should not be case sensitive.

GOOD LUCK!

««« Discuss your solution @python_programmers_club and proper solutions will be added to our Github page »»»

««« Click here for the Solution »»»

🔥Ready to take this challenge? 🔥

#python #practiceCode #samples #interviewQuestions #conditions
Forwarded from Python Questions
#interviewQuestions : 0007

What is the output of the following statement? Explain Why?

16//-3
Output: -6

// (Floor division)
It gives the floor value of the quotient produced by dividing the two operands. In other words, the floor division // rounds the result down to the nearest whole number.
print(x/y)
print(x//y)
Notice that we are using the same values for x and y operands. But the result is quite different between / and //.
When the result of floor division (//) is positive, it is as though the fractional portion is truncated off, leaving only the integer portion.
When the result is negative, the result is floored, i.e., rounded away from zero (towards negative infinity). In other words, rounded down to the next smallest (greater negative) integer.
Let us see some more examples.
print(float(x)//float(y)) # Notice the result will also be a float.

x = -13 # Notice the value of `x` is assigned by with a unary negation (`-`) operator
y = 3
print(x//y) # Notice the result.
# Instead of rounding up to 4 like in the case of a positive result, it round up to -5, the lesser value

x= -13.0 # We changed the type of `x` from int to float. No change in value.
print(x//y) # What will be the result.
Unlike the standard division (/), the result is not always a float. But when one of the operands is a float, then the result will also be a float.
Division by zero will yield in the same error as above.