Skip to main content

Intro about Password Validator Caesar Cipher and Emirp mumbers

Password Validator
Password validator is a program that validates passwords to match specific rules. For example, the minimum length of the password must be eight characters long and it should have at least one uppercase letter in it.
A valid password is the one that conforms to the following rules:
- Minimum length is 5;
- Maximum length is 10;
- Should contain at least one number;
- Should contain at least one special character (such as &, +, @, $, #, %, etc.);
- Should not contain spaces.
Examples:
Input: "Sololearn"
Output: false
Input: "John Doe"
Output: false
Input: "$ololearn7"
Output: true
Write a program to checks if the user input is a valid password or not.


Caesar Cipher
The Caesar cipher is a type of substitution cipher in which each letter in the plaintext is shifted to a certain number of places down the alphabet. For example, with a shift of 1, A would be replaced by B, B would become C, and so on. The method is named after Julius Caesar, who allegedly used it to communicate with his generals.
For example:
Input: "defend the east wall of the castle"
Output: "efgfoe uif fbtu xbmm pg uif dbtumf"
Write a program that encrypts the user input using the Caesar cipher.


Emirp mumbers
An emirp is a prime number that results in a different prime when its decimal digits are reversed. For example, 13 is an emirp number because both 13 and 31 are prime numbers.
For example:
Input: 17
Output: true (17 and 71 are prime numbers)
Input: 113
Output: true (113 and 311 are prime numbers)
Input: 23
Output: false (23 is a prime number, but 32 is not)
Write a program to check if the user input is an emirp number or not.




Find The First Recurring Character
Write a program that takes a string asinput and returns the first recurring character as the output.

For example:
Input: "ABCA"
Output: A

Input: "BCABA"
Output: B

Input: "ABC"
Output: None

Comments

Popular posts from this blog

Top 5 programming language for artificial intelligence research

Here are the top 5 programming languages for artificial intelligence research: 1. LISP LISP (List Processing) is that high level language which impresses AI developers quite well and has been used in many classic AI Projects as well. The factor that places it at the last position is that, in comparison to others it is not fast. 2. C++ The very reason C++ is used in AI solutions is its speed; it is probably the fastest language out of all. Therefore, whenever speed is the prime concern of any AI developer, C++ is opted. 3. JAVA Java is in the top five because of its familiarity and easy to use features. This OOP language allows easy coding of algorithms which covers the major part of AI. 4. Prolog The reason Prolog is preferred for AI solutions is that it pretty much revolves around a dedicated set of mechanisms which consists of a small, flexible yet well-built programming framework. 5. Python One of the leading languages used for developin...

The Entrepreneurial Journey of Ashish Mishra: A Visionary Leader in Business and Technology

In the dynamic world of business and technology, Ashish Mishra stands out as a true trailblazer, successfully navigating the realms of entrepreneurship with two thriving ventures under his belt. With an impressive background as a salesperson and a keen eye for business opportunities, Ashish has carved a niche for himself as the founder and driving force behind Pentagon Decorators and Tech HB82. Early Career: A Foundation in Sales Ashish's journey into the business world began as a salesperson, where he honed his communication skills and developed a deep understanding of customer needs. Spending nearly three years in the challenging yet rewarding field of sales laid the groundwork for his future ventures. It was during this time that he cultivated the entrepreneurial spirit that would eventually lead him to launch his own businesses. Tech HB82: Bridging the Gap in Technology In 2019, Ashish took a bold step into the tech industry with the inception of Tech HB82. Recognizing the eve...

Computing in Python I: Fundamentals and Procedural Programming

Learn the fundamentals of computer programming in Python, from the basics of how a computer runs lines of code, to the write-run-debug cycle of program development, to working with variables, mathematical operators, and logical operators.      Techhb82    About this course This course starts from the beginning, covering the basics of how a computer interprets lines of code; how to write programs, evaluate their output, and revise the code itself; how to work with variables and their changing values; and how to use mathematical, boolean, and relational operators. By the end of this course, you'll be able to write small programs in Python that use variables, mathematical operators, and logical operators. For example, you could write programs that carry out complex mathematical operations, like calculating the interest rate necessary to reach a savings goal, recommending apparel options based on weather patterns, or calculating a grade based ...