GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

Write a program that asks the user to enter a password. The…

Write a program that asks the user to enter a password. The password must be at least 8 characters long and contain at least one uppercase letter, one lowercase letter, and one digit. The program should validate the input and display an appropriate message. Source Code: def is_valid_password(password):     has_upper = any(char.isupper() for char in           1          )     has_lower = any(           2             for char in password)     has_digit = any(char.isdigit() for char in password)     return      3     (password) >= 8 and has_upper and has_lower and has_digit def main():     password = input(“Enter a password: “)     if              4              (password):         print(“Password is valid.”)     else:         print(“Invalid password. It must be at least 8 characters long and contain at least one uppercase letter, one lowercase letter, and one digit.”)        5     ()

Read Details

One-half liter of water is the same volume as 

One-half liter of water is the same volume as 

Read Details

A controlled experiment comparing two situations has all ide…

A controlled experiment comparing two situations has all identical influencing factors except the 

Read Details

Procedures operate on data items that are separate from the…

Procedures operate on data items that are separate from the procedures.

Read Details

A 5 km span is the same as how many meters?

A 5 km span is the same as how many meters?

Read Details

Write a class named Employee that has the following data att…

Write a class named Employee that has the following data attributes: __name (employee name) __id_number (employee ID number) __department (employee department) __job_title (employee job title) The class should include an __init__ method to initialize the attributes and should also include accessor (get) and mutator (set) methods for each attribute. Write a program that prompts the user to enter information about an employee and then displays the stored data. Source Code: class Employee:     def __init__(         1        ,           2        ,            3         ,           4           ,          5        ):         self.__name = name         self.__id_number = id_number         self.__department = department               6     .__job_title = job_title    def set_name(self, name):         self.__name = name   def set_id_number(self, id_number):         self.__id_number = id_number   def                7              (self, department):         self.__department = department   def set_job_title(self, job_title):         self.__job_title = job_title   def get_name(     8     ):         return self.__name   def             9           (self):         return self.__id_number   def get_department(self):         return self.__department   def get_job_title(self):         return self.__job_title # Program to use the class name = input(“Enter employee’s name: “) id_number = input(“Enter employee ID number: “) department = input(“Enter department: “) job_title = input(“Enter job title: “) emp = Employee(name, id_number, department, job_title) print(“\nEmployee Information:”) print(“Name:”, emp.get_name()) print(“ID Number:”, emp.get_id_number()) print(“Department:”,                 10                 ()) print(“Job Title:”, emp.get_job_title())

Read Details

What will be the output after the following code is executed…

What will be the output after the following code is executed?import matplotlib.pyplot as pltdef main(): x_crd = [0, 1 , 2, 3, 4, 5] y_crd = [2, 4, 5, 2] plt.plot(x_crd, y_crd)main()

Read Details

What will be the value of the variable string after the foll…

What will be the value of the variable string after the following code executes?string = ‘abcd’string.upper()

Read Details

The CPA is a measurement of:

The CPA is a measurement of:

Read Details

What is the output of the following print statement?print(‘T…

What is the output of the following print statement?print(‘The path is D:\\sample\\test.’)

Read Details

Posts pagination

Newer posts 1 … 37,407 37,408 37,409 37,410 37,411 … 96,632 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top