create account

Python Video Tutorial 1- Alarm Program by redart

View this thread on: hive.blogpeakd.comecency.com
· @redart · (edited)
$2.75
Python Video Tutorial 1- Alarm Program
![python video tutorial2.jpg](https://cdn.utopian.io/posts/03cb18957d012179050fb04935afc69d98fcpython_video_tutorial2.jpg)

#### What Will I Learn?

- You will learn to write an alarm program in Python language
- You will learn to use the "while" loops
- You will learn to use 'if, elif and else' functions from conditional states
- You will learn to use the 'time' library and the 'localtime' module
- You will improve your algorithm ability when writing programs

#### Requirements

- Python 3.6.5
- Pycharm or another text editors (python idle)

#### Difficulty

- Intermediate

#### Links
- [Python Download Link](https://www.python.org/downloads/)
- [Pycharm Download Link](https://www.jetbrains.com/pycharm/download/#section=windows)
- [My Github Repository Link (Python Samples2)](https://github.com/redart16/Python-samples2)

#### Codes
``` 
print("""******************

Alarm Program

******************""")

import time

Ahour = int(input("Please enter the alarm hour:"))
Aminute = int(input("Please enter the alarm minute:"))

while True:
    LT = time.localtime(time.time())
    if Ahour == LT.tm_hour and Aminute == LT.tm_min :
        print( "Time is:", LT.tm_hour, ":", LT.tm_min, "The alarm is ringing")
        break
    elif (LT.tm_min == 30 and LT.tm_sec ==1 ) or (LT.tm_min == 7 and LT.tm_sec ==1 ):
        rhour = Ahour - LT.tm_hour
        rminute= Aminute - LT.tm_min
        print( "Remaining to Alarm:", rhour, ":", rminute)
    else:
        pass

print (" The Alarm Has been terminated")



```
#### Description
In this lesson I will tell you how to write the Alarm application in Python language. We use the 'time' library when designing the alarm program algorithm. By using the 'locatime' module in this library, we instantly get the clock data of our computer into the program.  The alarm starts by asking the user to enter the alarm time and minute.  After this phase, we are beginning to test the alarm information that the user has entered in the 'while' loop.  We check that the alarm clock entered in the test phase matches the local time of our computer. In this control phase we use 'if, elif and else' functions. You can see the details of these functions in the codes and videos we have done.  We also learned not to get the duration of the alarm to be steady at certain intervals within the program. I hope that this content is useful for you.
##### Step -1
In the first step, we enter the name of our program and import the 'time' library
![step1.PNG](https://cdn.utopian.io/posts/1056a198f3129d983f54f89c47e084899fc3step1.PNG)

##### Step -2
In the second step, we define our variables so that the user can enter the alarm time.

![step2.PNG](https://cdn.utopian.io/posts/3530e51d0e7ce32a3cd1cfb19be1870537a9step2.PNG)

##### Step -3
In the third step, we start the 'while' cycle according to the condition of 'True'.
![step3.PNG](https://cdn.utopian.io/posts/abf3b6b4f0522b1058fa2a8e71b4b335c499step3.PNG)

##### Step -4
In the fourth step, we set the conditions according to the alarm time that the user has entered and make sure that they are tested.
![step-4.PNG](https://cdn.utopian.io/posts/383ecabf6fab20b2d5614fe3ea7ce531cd8fstep-4.PNG)

##### Step -5
In the fifth step, we complete the program by typing the expression indicating the end of our program.

![step 5.PNG](https://cdn.utopian.io/posts/ddde20dc54dabc4661afef4134db9f156fcestep_5.PNG)


#### Video Tutorial
https://www.youtube.com/watch?v=36eJUAvHl0o&feature=youtu.be

#### Curriculum
- This is the first part of the Python  Video Tutorial Serie
    

<br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@redart/ptyhon-video-tutorial-1-alarm-program">Utopian.io -  Rewarding Open Source Contributors</a></em><hr/>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 97 others
properties (23)
authorredart
permlinkptyhon-video-tutorial-1-alarm-program
categoryutopian-io
json_metadata"{"community":"utopian","app":"utopian/1.0.0","format":"markdown","repository":{"id":81598961,"name":"cpython","full_name":"python/cpython","html_url":"https://github.com/python/cpython","fork":false,"owner":{"login":"python"}},"pullRequests":[],"platform":"github","type":"video-tutorials","tags":["utopian-io","python","tutorial"],"users":["redart"],"links":["https://cdn.utopian.io/posts/03cb18957d012179050fb04935afc69d98fcpython_video_tutorial2.jpg","https://www.python.org/downloads/","https://www.jetbrains.com/pycharm/download/#section=windows","https://github.com/redart16/Python-samples2","https://cdn.utopian.io/posts/1056a198f3129d983f54f89c47e084899fc3step1.PNG","https://cdn.utopian.io/posts/3530e51d0e7ce32a3cd1cfb19be1870537a9step2.PNG","https://cdn.utopian.io/posts/abf3b6b4f0522b1058fa2a8e71b4b335c499step3.PNG","https://cdn.utopian.io/posts/383ecabf6fab20b2d5614fe3ea7ce531cd8fstep-4.PNG","https://cdn.utopian.io/posts/ddde20dc54dabc4661afef4134db9f156fcestep_5.PNG"],"image":["https://cdn.utopian.io/posts/03cb18957d012179050fb04935afc69d98fcpython_video_tutorial2.jpg","https://cdn.utopian.io/posts/1056a198f3129d983f54f89c47e084899fc3step1.PNG","https://cdn.utopian.io/posts/3530e51d0e7ce32a3cd1cfb19be1870537a9step2.PNG","https://cdn.utopian.io/posts/abf3b6b4f0522b1058fa2a8e71b4b335c499step3.PNG","https://cdn.utopian.io/posts/383ecabf6fab20b2d5614fe3ea7ce531cd8fstep-4.PNG","https://cdn.utopian.io/posts/ddde20dc54dabc4661afef4134db9f156fcestep_5.PNG"],"moderator":{"account":"rosatravels","time":"2018-04-24T10:18:09.833Z","pending":false,"reviewed":false,"flagged":true},"questions":{"voters":["espoem","rosatravels","bahadirbayin"],"answers":[{"question_id":"vtuts-1","answer_id":"vtuts-1-a-3","user":"espoem","influence":100},{"question_id":"vtuts-2","answer_id":"vtuts-2-a-3","user":"espoem","influence":100},{"question_id":"vtuts-3","answer_id":"vtuts-3-a-3","user":"espoem","influence":100},{"question_id":"vtuts-4","answer_id":"vtuts-4-a-3","user":"espoem","influence":100},{"question_id":"vtuts-5","answer_id":"vtuts-5-a-3","user":"espoem","influence":100},{"question_id":"vtuts-6","answer_id":"vtuts-6-a-2","user":"espoem","influence":100},{"question_id":"vtuts-7","answer_id":"vtuts-7-a-3","user":"espoem","influence":100},{"question_id":"c-1","answer_id":"c-1-a-3","user":"espoem","influence":100},{"question_id":"c-2","answer_id":"c-2-a-4","user":"espoem","influence":100},{"question_id":"vtuts-1","answer_id":"vtuts-1-a-3","user":"rosatravels","influence":75},{"question_id":"vtuts-2","answer_id":"vtuts-2-a-3","user":"rosatravels","influence":75},{"question_id":"vtuts-3","answer_id":"vtuts-3-a-4","user":"rosatravels","influence":75},{"question_id":"vtuts-4","answer_id":"vtuts-4-a-4","user":"rosatravels","influence":75},{"question_id":"vtuts-5","answer_id":"vtuts-5-a-3","user":"rosatravels","influence":75},{"question_id":"vtuts-6","answer_id":"vtuts-6-a-3","user":"rosatravels","influence":75},{"question_id":"vtuts-7","answer_id":"vtuts-7-a-3","user":"rosatravels","influence":75},{"question_id":"c-1","answer_id":"c-1-a-3","user":"rosatravels","influence":75},{"question_id":"c-2","answer_id":"c-2-a-4","user":"rosatravels","influence":75},{"question_id":"vtuts-1","answer_id":"vtuts-1-a-2","user":"bahadirbayin","influence":15},{"question_id":"vtuts-2","answer_id":"vtuts-2-a-2","user":"bahadirbayin","influence":15},{"question_id":"vtuts-3","answer_id":"vtuts-3-a-3","user":"bahadirbayin","influence":15},{"question_id":"vtuts-4","answer_id":"vtuts-4-a-2","user":"bahadirbayin","influence":15},{"question_id":"vtuts-5","answer_id":"vtuts-5-a-2","user":"bahadirbayin","influence":15},{"question_id":"vtuts-6","answer_id":"vtuts-6-a-2","user":"bahadirbayin","influence":15},{"question_id":"vtuts-7","answer_id":"vtuts-7-a-3","user":"bahadirbayin","influence":15},{"question_id":"c-1","answer_id":"c-1-a-2","user":"bahadirbayin","influence":15},{"question_id":"c-2","answer_id":"c-2-a-3","user":"bahadirbayin","influence":15}],"total_influence":0,"most_rated":[{"question_id":"vtuts-1","answer_id":"vtuts-1-a-3","influence":175,"voters":["espoem","rosatravels"]},{"question_id":"vtuts-2","answer_id":"vtuts-2-a-3","influence":175,"voters":["espoem","rosatravels"]},{"question_id":"vtuts-3","answer_id":"vtuts-3-a-3","influence":115,"voters":["espoem","bahadirbayin"]},{"question_id":"vtuts-4","answer_id":"vtuts-4-a-3","influence":100,"voters":["espoem"]},{"question_id":"vtuts-5","answer_id":"vtuts-5-a-3","influence":175,"voters":["espoem","rosatravels"]},{"question_id":"vtuts-6","answer_id":"vtuts-6-a-2","influence":115,"voters":["espoem","bahadirbayin"]},{"question_id":"vtuts-7","answer_id":"vtuts-7-a-3","influence":190,"voters":["espoem","rosatravels","bahadirbayin"]},{"question_id":"c-1","answer_id":"c-1-a-3","influence":175,"voters":["espoem","rosatravels"]},{"question_id":"c-2","answer_id":"c-2-a-4","influence":175,"voters":["espoem","rosatravels"]}]},"score":37.5,"total_influence":190,"staff_pick":null,"config":{"questions":[{"question":"How many substantial concepts does this tutorial address?","question_id":"vtuts-1","answers":[{"answer":"4-5 substantial concepts covered in the tutorial.","answer_id":"vtuts-1-a-1","value":10},{"answer":"2-3 substantial concepts covered in the tutorial.","answer_id":"vtuts-1-a-2","value":7},{"answer":"1 substantial concept covered in the tutorial.","answer_id":"vtuts-1-a-3","value":2},{"answer":"More than 5 substantial concepts covered in the tutorial.","answer_id":"vtuts-1-a-4","value":0}]},{"question":"How informative is the content included alongside the video?","question_id":"vtuts-2","answers":[{"answer":"Exceptionally good text and, when applicable, images for concepts covered.","answer_id":"vtuts-2-a-1","value":20},{"answer":"Thorough text and, if applicable, images for concepts covered.","answer_id":"vtuts-2-a-2","value":18},{"answer":"Minimal text and images.","answer_id":"vtuts-2-a-3","value":10},{"answer":"No or very little text and images.","answer_id":"vtuts-2-a-4","value":0}]},{"question":"Is the video clearly prepared and structured?","question_id":"vtuts-3","answers":[{"answer":"Both the presenter and the video are exceptionally organized, structured and presented","answer_id":"vtuts-3-a-1","value":20},{"answer":"Presenter is prepared and video concepts are structured.","answer_id":"vtuts-3-a-2","value":16},{"answer":"Presenter has moments when he/she seems unprepared and/or the content seems to be unstructured.","answer_id":"vtuts-3-a-3","value":8},{"answer":"Presenter seems unprepared and/or video is unstructured.","answer_id":"vtuts-3-a-4","value":0}]},{"question":"Does the contributor provide supplementary resources, such as code and sample files in the contribution post or a GitHub repository?","question_id":"vtuts-4","answers":[{"answer":"Contributor provided exceptional supplementary resources.","answer_id":"vtuts-4-a-1","value":5},{"answer":"Contributor provided good supplementary resources.","answer_id":"vtuts-4-a-2","value":4},{"answer":"Contributor provided minimal supplementary resources.","answer_id":"vtuts-4-a-3","value":1.5},{"answer":"No supplementary resources were provided.","answer_id":"vtuts-4-a-4","value":0}]},{"question":"How would you describe the sound quality of the video?","question_id":"vtuts-5","answers":[{"answer":"Sound quality is excellent and sounds professionally produced.","answer_id":"vtuts-5-a-1","value":10},{"answer":"The sound is clear and understandable with complimenting background music / sounds.","answer_id":"vtuts-5-a-2","value":8},{"answer":"Low quality of sound and/or mildly distracting background noise.","answer_id":"vtuts-5-a-3","value":3},{"answer":"Distracting background noise and/or very low quality recording.","answer_id":"vtuts-5-a-4","value":0}]},{"question":"Does the presenter speak clearly and is easy to understand?","question_id":"vtuts-6","answers":[{"answer":"Yes, presenter’s speech is highly engaging and professional.","answer_id":"vtuts-6-a-1","value":10},{"answer":"Yes, the voice-over is easy to understand.","answer_id":"vtuts-6-a-2","value":8},{"answer":"Only some of the voice-over was comprehensible.","answer_id":"vtuts-6-a-3","value":4},{"answer":"The voice-over was impossible to understand / not included at all.","answer_id":"vtuts-6-a-4","value":0}]},{"question":"Are the title of the tutorial and the concepts being covered present on the video in text overlay form?","question_id":"vtuts-7","answers":[{"answer":"Title and concepts covered are present in the video at all times in a non-disruptive way.","answer_id":"vtuts-7-a-1","value":5},{"answer":"Title and concepts covered appear temporarily when they are addressed.","answer_id":"vtuts-7-a-2","value":4.5},{"answer":"Only the title is presented and the concepts shown are not addressed in overlay text.","answer_id":"vtuts-7-a-3","value":2},{"answer":"Neither title nor concepts covered are presented in the video text overlay.","answer_id":"vtuts-7-a-4","value":0}]},{"question":"How would you describe the formatting, language and overall presentation of the post?","question_id":"c-1","answers":[{"answer":"The quality of the post is fantastic.","answer_id":"c-1-a-1","value":10},{"answer":"The post is of very good quality.","answer_id":"c-1-a-2","value":7},{"answer":"The post is poorly written and/or formatted, but readable.","answer_id":"c-1-a-3","value":3},{"answer":"The post is really hard to read and the content is barely understandable.","answer_id":"c-1-a-4","value":0}]},{"question":"How would you rate the overall value of this contribution on the open source community and ecosystem?","question_id":"c-2","answers":[{"answer":"This contribution brings great and impactful value, and can be used for applications outside the specific project.","answer_id":"c-2-a-1","value":20},{"answer":"This contribution adds significant value to the open source community and ecosystem, or is of critical importance to the specific project.","answer_id":"c-2-a-2","value":18},{"answer":"This contribution adds some value to the open source community and ecosystem or is only valuable to the specific project.","answer_id":"c-2-a-3","value":11},{"answer":"This contribution adds no value to the open source community and ecosystem or the specific project.","answer_id":"c-2-a-4","value":0}]}]}}"
created2018-04-23 17:43:45
last_update2018-04-24 10:18:09
depth0
children2
last_payout2018-04-30 17:43:45
cashout_time1969-12-31 23:59:59
total_payout_value2.660 HBD
curator_payout_value0.088 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length3,739
author_reputation6,723,529,098,076
root_title"Python Video Tutorial 1- Alarm Program"
beneficiaries
0.
accountutopian.pay
weight1,500
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id51,720,317
net_rshares466,917,650,534
author_curate_reward""
vote details (161)
@rosatravels ·
Thank you for your contribution. It has been reviewed and scored.

@redart, you need to work on the tutorial itself because the tutorial should bring insights into the Open Source Project so that learners can use the technical features after watching your video.

You also need to work on the tutorial by presenting clearly the concepts.  Presently, there is no structure in the presentation although you try to lay out the steps for learners to follow.

Try to work on a flow in the video so that your users can stay engaged as they learn from your video.  Write out a draft or script for yourself to follow.  You need to edit out the parts where your presentation brings no significant value to the tutorial.

If you  have questions, please contact us at discord.

----------------------------------------------------------------------
Need help? Write a ticket on https://support.utopian.io.
Chat with us on [Discord](https://discord.gg/uTyJkNm).

**[[utopian-moderator]](https://utopian.io/moderators)**
properties (22)
authorrosatravels
permlinkre-redart-ptyhon-video-tutorial-1-alarm-program-20180424t084105448z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2018-04-24 08:41:09
last_update2018-04-24 08:41:09
depth1
children1
last_payout2018-05-01 08:41:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,007
author_reputation422,827,447,688,168
root_title"Python Video Tutorial 1- Alarm Program"
beneficiaries
0.
accountutopian.pay
weight1,500
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id51,828,060
net_rshares0
@redart ·
Thanks for your valuable comments. I will improve myself by taking into what you say and I will make my contributions more useful.
properties (22)
authorredart
permlinkre-rosatravels-re-redart-ptyhon-video-tutorial-1-alarm-program-20180424t085339819z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2018-04-24 08:53:39
last_update2018-04-24 08:53:39
depth2
children0
last_payout2018-05-01 08:53:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length130
author_reputation6,723,529,098,076
root_title"Python Video Tutorial 1- Alarm Program"
beneficiaries
0.
accountutopian.pay
weight1,500
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id51,829,697
net_rshares0