Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A unexpected indent error
#2
Use code tags.
Line 14 you indent where it should not be indent.
import random
import string

adjectives = ['sleepy', 'slow', 'smelly', 'wet', 'fat', 'red', 'orange', 'yellow', 'green', 'blue', 'purple', 'fluffy', 'white', 'proud', 'brave']
nouns = ['apple', 'dinosaur', 'ball', 'toaster', 'goat', 'dragon', 'hammer', 'duck', 'panda']

print('Welcome to Password Picker!')
adjective = random.choice(adjectives)
noun = random.choice(nouns)
number = random.randrange(0,100)
special_char = random.choice(string.punctuation)
password = adjective + noun + str(number) + special_char
print(f'your new password is: {password}')
Output:
your new password is: fluffypanda36>
Reply


Messages In This Thread
A unexpected indent error - by Zyh3rbr0 - Dec-14-2024, 06:25 AM
RE: A unexpected indent error - by snippsat - Dec-14-2024, 07:01 AM
RE: A unexpected indent error - by Zyh3rbr0 - Dec-14-2024, 07:13 AM
RE: A unexpected indent error - by snippsat - Dec-14-2024, 12:37 PM
RE: A unexpected indent error - by deanhystad - Dec-14-2024, 04:45 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  getting unexpected indent errors trying to move cells up jensengt 4 1,984 Jun-28-2023, 12:05 PM
Last Post: deanhystad
  xml indent SubElements (wrapping) with multiple strings ctrldan 2 3,416 Jun-09-2023, 08:42 PM
Last Post: ctrldan
  IndentationError: unexpected indent dee 3 4,114 May-02-2022, 02:15 AM
Last Post: dee
  Avoid multiple repeat in indent Frankduc 8 4,777 Jan-18-2022, 05:46 PM
Last Post: Frankduc
  Unexpected syntax error djwilson0495 7 4,899 Aug-25-2020, 01:34 PM
Last Post: deanhystad
  Unexpected syntax error djwilson0495 5 3,630 Jul-20-2020, 04:23 PM
Last Post: buran
  Syntax error: "(" unexpected buttercup 4 4,185 Jul-20-2020, 06:25 AM
Last Post: buttercup
  IndentationError: unexpected indent jk91 1 3,208 Feb-27-2020, 08:56 PM
Last Post: buran
  Getting an "Unexpected Token" Error and don't know why... NotAHackusator 1 2,514 Nov-20-2019, 03:00 PM
Last Post: buran
  could not fix unexpected indent Bayan 1 4,317 Nov-08-2019, 01:45 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020