Skip to content

Commit c33556f

Browse files
possible passwords times out of 6 letter password combination
1 parent c9bf427 commit c33556f

File tree

3 files changed

+64
-1
lines changed

3 files changed

+64
-1
lines changed

Diff for: .idea/workspace.xml

+31-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# # Problem 1
2+
# """
3+
# Use Python to calculate how many different passwords can be formed with 6 lower case English letters
4+
# (excludes any character not found in the English alphabet).
5+
# For a 1 letter password, there would be 26 possibilities.
6+
# For a 2 letter password, each letter is independent of the other, so there would be 26 times 26 possibilities.
7+
# Using this information, print the amount of possible passwords that can be formed with 6 letters.
8+
# """
9+
10+
11+
# Answer :-
12+
"""
13+
To calculate the number of possible 6-letters passwords we use the fact that each letter in the password
14+
can be chosen independently form 26 lowercase English letters.
15+
16+
FOR each position int the password :
17+
- There are 26 possible choices for the first letter.
18+
- There are 26 possible choices for the second letter.
19+
- This pattern will continue for all the 6 letters.
20+
21+
The total number of different password is 26* 26* 26* 26* 26*26 = 26 **6
22+
Calculating this, we get 308,915,776 possible passwords
23+
24+
"""
25+
# let's give it a try ..
26+
27+
english_letters = 26
28+
Password_letters = 6
29+
print(f" The value of {str(english_letters ** Password_letters)} is the possible passwords ")

Diff for: Python With Google--Crash Course on Python/Module01 - Hello Python/Study Guide- Module 1 Graded Quiz.py

+4
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,7 @@
4646
# print the calculation stored int the "weeks_in_year" variables
4747
print(weeks_in_decade)
4848

49+
# Skill 3 -- Use variables with assignment and arithmetic operators
50+
# Assignment of values to the variables
51+
52+

0 commit comments

Comments
 (0)