Conditions and Functions | Python for Machine Learning | Session 2

preview_player
Показать описание
This Python for Machine Learning Tutorial will help you learn the Python programming language from scratch. Everything in this course is explained with the relevant example thus you will actually know how to implement the topics that you will learn in this course.

Following are the concepts that are covered in this course:

Let us know in the comments below if you find it helpful.

________

Рекомендации по теме
Комментарии
Автор

left_top_x = 0
left_top_y = 0
right_top_x = 10
right_top_y = 20

x = float(input("Please enter the X coordinate : "))
y = float(input("Please enter the Y coordinate : "))

if x>=left_top_x and x<=right_top_x and y>=left_top_y and y<=right_top_y:
print('Point is inside the Rectangle')

else:
print('Point is outside the Rectangle')

pimppakoda
Автор

Last problem :-

hours = int(input('Please enter the hours worked : '))
rate = 10

def pay(hours, rate):
income = hours*rate
return income

def over_pay(hours, rate):
extra_pay = (hours-40)*15
income = (40*rate)+extra_pay
return income

if hours>40:
income = over_pay(hours, rate)
print(income)

else:
income = pay(hours, rate)
print(income)

pimppakoda