Skip to content

About

This is lesson 1 of learning Python from scratch. You can check the codes and do practice.

Resources

Code of conduct

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

lesson_1_Python

This is lesson 1 of learning Python from scratch. You can check the codes and do practice. This project demonstrates the use of basic Python concepts, external modules, and built-in modules through simple and practical examples.

📌 Features 😂 Generate random jokes using pyjokes 🔊 Convert text to speech using pyttsx3 📂 Display directory contents using os module ✨ Print a classic poem (Twinkle Twinkle Little Star) 🔢 Print multiplication table of 5 🧩 Modules Used 🔹 External Modules

These need to be installed manually:

pyjokes → For generating random jokes pyttsx3 → For text-to-speech conversion 🔹 Built-in Modules

Already available in Python:

os → For interacting with the operating system ⚙️ Installation

Make sure you have Python installed, then install required modules:

pip install pyjokes pyttsx3 🚀 How to Run Clone the repository: git clone cd Run the Python script: python your_script_name.py 📁 What the Code Does

  1. 😂 Print a Joke

Uses pyjokes.get_joke() to display a random joke.

  1. 📜 Print Poem

Prints the famous Twinkle Twinkle Little Star poem using multi-line strings.

  1. 🔢 Multiplication Table

Prints the table of 5 using basic arithmetic operations.

  1. 📂 Directory Listing

Defines a function:

print_directory_contents(directory) Lists all files and folders in a given directory Uses os.scandir() 5. 🔊 Text-to-Speech

Uses pyttsx3 to speak the directory path aloud.

📸 Sample Output Why do programmers prefer dark mode? Because light attracts bugs!

Twinkle, twinkle, little star...

5 * 1 = 5 5 * 2 = 10 ...

Contents of directory '.': File: main.py Directory: assets

About

This is lesson 1 of learning Python from scratch. You can check the codes and do practice.

Resources

Code of conduct

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages