Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

NEED HELP this need to be in python code 1. Return the number of positive ints in the given list. Note: 0 is neither positive

NEED HELP
this need to be in python code image text in transcribed
1. Return the number of positive ints in the given list. Note: 0 is neither positive nor negative. Examples: countPositive(2,5,-3,-8, 4, 0) 3 countPositive((-1, 3, 2, -2, -50) + 2 count Positive( -100, -10,0) 0 def count Positive (nums): 2. Return True if the last element of the list is greater than or equal to the first element in the biglast((-1, 3, 2, -2, 50)) True Examples: biglast(2, 5, -3, -8, 4,0) False biglast((-100, -10,00) True def big Last (nums): 3. Given a day of the week encoded as 0 Sun, 1-Mon, 2- Tue, ...6 Sat, and a boolean indicating if we are on vacation, return a string of the form "7:00" indicating when the alarm clock should ring. Weekdays, the alarm should be "7:00' and on the weekend it should be "10:00". Unless we are on vacation - then on weekdays it should be "10:00" and weekends it should be "off". Examples: alarm(1, False) 7:00 alarm(5, True) 10:00 alarm(0, False) "10:00 alarm(0, True) - 'off def alarm (day, vacation)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions