Let's Buy a Car! | Teacher Resources | Financial Literacy | Khan Academy
Meet Wally. He wants to buy a car! Unfortunately, Wally is the most gullible man alive, and he'll fall for every trick in the car dealer's book. Follow along, so you don't follow his example! Courses on Khan Academy are always 100% free. Start practicing—and saving your progress—now! https://www.khanacademy.org/college-careers-more/financial-literacy/xa6995ea67a8e9fdd:teacher-resources/xa6995ea67a8e9fdd:about-this-unit-investments-and-retirement/v/the-case-of-the-early-bird Khan Academy is a nonprofit organization with the mission of providing a free, world-class education for anyone, anywhere. We offer quizzes, questions, instructional videos, and articles on a range of academic subjects, including math, biology, chemistry, physics, history, economics, finance, grammar, preschool learning, and more. We provide teachers with tools and data so they can help their students develop the skills, habits, and mindsets for success in school and beyond. Khan Academy has been translated into dozens of languages, and 15 million people around the globe learn on Khan Academy every month. As a 501(c)(3) nonprofit organization, we would love your help! Donate or volunteer today! Donate here: https://www.khanacademy.org/donate?utm_source=youtube&utm_medium=desc Volunteer here: https://www.khanacademy.org/contribute?utm_source=youtube&utm_medium=desc All music and sound effects are either Creative Commons 0 or own work.
7/15/2024 4:15:36 PM
Let's code a Digital Clock in Python! 🕒
#python #pythontutorial #pythoncourseforbeginners 00:00:00 pip install PyQt5 00:00:41 imports 00:01:57 class DigitalClock(QWidget) 00:02:59 if __name__ == "__main__" 00:04:48 setting up __init__() 00:05:29 initUI() 00:10:03 update_time() 00:12:47 custom font ## Python PyQt5 Digital Clock import sys from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QVBoxLayout from PyQt5.QtCore import QTimer, QTime, Qt from PyQt5.QtGui import QFont, QFontDatabase class DigitalClock(QWidget): def __init__(self): super().__init__() self.time_label = QLabel(self) self.timer = QTimer(self) self.initUI() def initUI(self): self.setWindowTitle("Digital Clock") self.setGeometry(600, 400, 300, 100) vbox = QVBoxLayout() vbox.addWidget(self.time_label) self.setLayout(vbox) self.time_label.setAlignment(Qt.AlignCenter) self.time_label.setStyleSheet("font-size: 150px;" "color: hsl(111, 100%, 50%);") self.setStyleSheet("background-color: black;") ## Use a custom font ## font_id = QFontDatabase.addApplicationFont("DS-DIGIT.TTF") ## font_family = QFontDatabase.applicationFontFamilies(font_id)[0] ## my_font = QFont(font_family, 300) ## self.time_label.setFont(my_font) self.timer.timeout.connect(self.update_time) self.timer.start(1000) self.update_time() def update_time(self): current_time = QTime.currentTime().toString("hh:mm:ss AP") self.time_label.setText(current_time) if __name__ == "__main__": app = QApplication(sys.argv) clock = DigitalClock() clock.show() sys.exit(app.exec_())
7/31/2024 1:01:24 PM