Posts

Showing posts from November, 2021

Password Generator Project 2 - (Advanced)

Image
  import random letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] symbols = ['!', '#', '$', '%', '&', '(', ')', '*', '+'] print("Welcome to t...

Password Generator Project 1 - Easy Code

Image
  #Password Generator Project import random letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] symbols = ['!', '#', '$', '%', '&', '(', ')', '*', '+...

FizzBuzz

Image
  for number in range(1, 101): if number % 3 == 0 and number % 5 == 0: print("FizzBuzz") elif number % 3 == 0: print("Fizz") elif number % 5 == 0: print("Buzz") else: print(number)

Students Average Height

Image
student_heights = input("Input a list of student heights>> " ).split() for n in range(0, len(student_heights)): student_heights[n] = int(student_heights[n]) #b = round(sum(student_heights)/len(student_heights)) #print(b) #print(student_heights) #m = len(student_heights) #t = student_heights[0] + student_heights[1] + student_heights[2] #print(round(t/m)) number_of_students = 0 for student in student_heights: number_of_students += 1 total_heights = 0 for height in student_heights: total_heights += height print(round(total_heights / number_of_students))