Python Forum
permutations calculation with a while instruction
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
permutations calculation with a while instruction
#3
Thank you,

Here a code which seem ok

x=input('donnez un nombre')
y=int(x)
a=1
while y>=1:
	a=a*y
	print('Current state:', y, y-1)
	y=y-1
print(a)
Reply


Messages In This Thread
RE: permutations calculation with a while instruction - by kwak86 - Sep-10-2018, 02:09 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Illegal instruction (core dumped) when import pandas. amandacstr 1 2,129 Dec-31-2022, 11:31 PM
Last Post: stevendaprano
  Creating permutations of N size with no same elements next to one another (recursion) melmoman 1 1,582 Dec-18-2021, 09:39 PM
Last Post: Larz60+
  Illegal instruction? working code for months? korenron 4 13,150 Aug-05-2021, 09:57 AM
Last Post: korenron
  What happens to a <itertools.permutations object at 0x7fe3cc66af68> after it is read? Pedroski55 3 2,424 Nov-29-2020, 08:35 AM
Last Post: DeaD_EyE
  Permutations mikke3141 2 20,920 Dec-23-2019, 06:09 PM
Last Post: mikke3141
  More Efficent Way of Generating Permutations/ w Rep ClassicalSoul 2 2,718 Aug-22-2019, 05:22 AM
Last Post: perfringo
  How to find the number of permutations of a list of lists? JoeB 5 5,373 Nov-18-2017, 06:31 PM
Last Post: heiner55
  instruction refused on a "while loop" sylas 11 7,892 May-22-2017, 08:09 AM
Last Post: sylas

Forum Jump:

User Panel Messages

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