This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| email = input("Enter Your Email: ").strip() | |
| username = email[:email.index('@')] | |
| domain = email[email.index('@') + 1:] | |
| print(f"Your username is {username} & your domain is {domain}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| row = int(input("Enter number of rows: ")) | |
| space = 36 | |
| a = [0] * 20 | |
| print("\n\t\t\t\t PASCAL'S TRIANGLE\n") | |
| for i in range(row): | |
| for spi in range(1,space+1): | |
| print(" ", end="") | |
| a[i] = 1 | |
| for j in range(i+1): | |
| print('%6d' %(a[j]), end = "") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| row = int(input('Enter number of rows: ')) | |
| number = 1 | |
| print('\n') | |
| for i in range(1,row+1): | |
| for j in range(1, i+1): | |
| print(number, end='\t') | |
| number += 1 | |
| print() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def triangleShape(n): | |
| for i in range(n): | |
| for j in range(n-i): | |
| print(' ', end=' ') | |
| for k in range(2*i+1): | |
| print('*',end=' ') | |
| print() | |
| def poleShape(n): | |
| for i in range(n): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pygame | |
| class Game: | |
| screen = None | |
| aliens = [] | |
| rockets = [] | |
| lost = False | |
| def __init__(self, width, height): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from tkinter import * | |
| import datetime | |
| import time | |
| import winsound | |
| def alarm(set_alarm_timer): | |
| while True: | |
| time.sleep(1) | |
| current_time = datetime.datetime.now() | |
| now = current_time.strftime("%H:%M:%S") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pygame | |
| import time | |
| import random | |
| snake_speed = 15 | |
| window_x = 720 | |
| window_y = 480 | |
| black = pygame.Color(0, 0, 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import turtle; import random; import time | |
| delay = 0.08 | |
| score = 0 | |
| high_score = 0 | |
| wn = turtle.Screen() | |
| wn.title("Snake Game") | |
| wn.bgcolor("green") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from turtle import * | |
| class Disc(Turtle): | |
| def __init__(self, n): | |
| Turtle.__init__(self, shape="square", visible=False) | |
| self.pu() | |
| self.shapesize(1.5, n*1.5, 2) | |
| self.fillcolor(n/6., 0, 1-n/6.) | |
| self.st() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| import string | |
| def get_secure_password(length): | |
| result_str = ''.join(random.choice(string.ascii_letters) for i in range(length)) | |
| print(result_str) | |
| get_secure_password(8) |