Posts

Showing posts from February, 2023

How to center an Youtube iframe horizontally?

Image
How to center an iframe horizontally? To center a YouTube <iframe> horizontally, you can use CSS.  To make you frame center you need to give your videowrapper a specific width and make the margin left and right as auto . Despite you wanna make your frame responsive always use max-width: 100% to your videowrapper .  Here's how you can do it using different approaches: 1. Using text-align on a Parent Container Wrap the <iframe> in a parent container and apply text-align: center to the container. html < div style = "text-align: center;" > < iframe width = "560" height = "315" src = "https://www.youtube.com/embed/dQw4w9WgXcQ" title = "YouTube video player" frameborder = "0" allowfullscreen > </ iframe > </ div > 2. Using Flexbox Flexbox is a modern and robust way to center elements. html < div style = "display: flex; justify-content: center;" >

Python Syntax

  Python  Syntax As we learned in the previous page, Python syntax can be executed by writing directly in the Command Line: >>> print("Hello, World!") Hello, World! Or by creating a python file on the server, using the .py file extension, and running it in the Command Line: C:\Users\ Your Name >python myfile.py Python Indentation Indentation refers to the spaces at the beginning of a code line. Where in other programming languages the indentation in code is for readability only, the indentation in Python is very important. Python uses indentation to indicate a block of code. Python has no command for declaring a variable. You will learn more about variables in the  Python Variables  chapter. Comments Python has commenting capability for the purpose of in-code documentation. Comments start with a #, and Python will render the rest of the line as a comment:

Python Getting Started

  Python  Getting Started Python Install Many PCs and Macs will have python already installed. To check if you have python installed on a Windows PC, search in the start bar for Python or run the following on the Command Line (cmd.exe): C:\Users\ Your Name >python --version To check if you have python installed on a Linux or Mac, then on linux open the command line or on Mac open the Terminal and type: python --version If you find that you do not have Python installed on your computer, then you can download it for free from the following website:  https://www.python.org/ Python Quickstart Python is an interpreted programming language, this means that as a developer you write Python (.py) files in a text editor and then put those files into the python interpreter to be executed. The way to run a python file is like this on the command line: C:\Users\ Your Name >python helloworld.py Where "helloworld.py" is the name of your python file. Let's write our first Python fi

Python Tutorial

  Python  Tutorial print ( "Hello, World!" ) What is Python? Python is a popular programming language. It was created by Guido van Rossum, and released in 1991. It is used for: web development (server-side), software development, mathematics, system scripting. What can Python do? Python can be used on a server to create web applications. Python can be used alongside software to create workflows. Python can connect to database systems. It can also read and modify files. Python can be used to handle big data and perform complex mathematics. Python can be used for rapid prototyping, or for production-ready software development. Why Python? Python works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc). Python has a simple syntax similar to the English language. Python has syntax that allows developers to write programs with fewer lines than some other programming languages. Python runs on an interpreter system, meaning that code can be executed as soon as it is wri