My pseudocode to Python?
Rob Gaddi
rgaddi at highlandtechnology.invalid
Mon Aug 19 14:25:01 EDT 2019
On 8/19/19 10:43 AM, Stefan Ram wrote:
> Can someone kindly translate my pseudocode to terse Python:
>
> list = \
> [ 'afaueghauihaiuhgaiuhgaiuhgaeihui',
> 'erghariughauieghaiughahgaihgaiuhgaiuh',
> 'rejganregairghaiurghaiuhgauihgauighaei',
> if x: 'argaeruighaiurhauirguiahuiahgiauhgaeuihi',
> 'reiugaheirughauierhgauiaeihauiehgiuaehuih'
> 'ejiaeigaiuegreaiugheiugheaiughauighaiughaiu'
> 'egairughauirghauiruiegihgruiehgiuaehgiaue' ]
>
> ? I want the list to have the seven strings shown as entries
> if bool(x) is True, but otherwise the list should only have
> six entries - without the entry directly behind "if x: ".
>
>
mylist = ['a', 'b', 'c', 'd', 'e', 'f', 'g']
if not x:
del mylist[3]
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
More information about the Python-list
mailing list