54th day of python challenges 78-79

This commit is contained in:
abd.shallal 2019-07-22 10:49:24 +03:00
parent 0734522641
commit 6a11f68f12
4 changed files with 119 additions and 61 deletions

View File

@ -32,6 +32,10 @@
<option value="E501" />
<option value="W29" />
<option value="E501" />
<option value="W29" />
<option value="E501" />
<option value="W29" />
<option value="E501" />
</list>
</option>
</inspection_tool>

View File

@ -2,15 +2,8 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="7106b959-52c5-4d26-9f5a-8703a78c8c29" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/challenges69-79/challenge-069.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/challenges69-79/challenge-070.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/challenges69-79/challenge-071.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/challenges69-79/challenge-072.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/challenges69-79/challenge-073.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/challenges69-79/challenge-074.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/challenges69-79/challenge-075.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/challenges69-79/challenge-076.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/challenges69-79/challenge-077.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/challenges69-79/challenge-078.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/challenges69-79/challenge-079.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/inspectionProfiles/Project_Default.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/inspectionProfiles/Project_Default.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
</list>
@ -31,11 +24,29 @@
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/challenges69-79/challenge-077.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="120">
<caret line="8" column="16" lean-forward="true" selection-start-line="8" selection-start-column="16" selection-end-line="8" selection-end-column="16" />
<caret line="8" column="16" selection-start-line="8" selection-start-column="16" selection-end-line="8" selection-end-column="16" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/challenges69-79/challenge-078.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="120">
<caret line="8" lean-forward="true" selection-start-line="8" selection-end-line="8" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/challenges69-79/challenge-079.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="120">
<caret line="8" column="21" selection-start-line="8" selection-start-column="21" selection-end-line="8" selection-end-column="21" />
</state>
</provider>
</entry>
@ -92,6 +103,8 @@
<option value="$PROJECT_DIR$/challenges69-79/challenge-075.py" />
<option value="$PROJECT_DIR$/challenges69-79/challenge-076.py" />
<option value="$PROJECT_DIR$/challenges69-79/challenge-077.py" />
<option value="$PROJECT_DIR$/challenges69-79/challenge-078.py" />
<option value="$PROJECT_DIR$/challenges69-79/challenge-079.py" />
</list>
</option>
</component>
@ -116,11 +129,6 @@
<item name="paython-by-learn" type="b2602c69:ProjectViewProjectNode" />
<item name="paython-by-learn" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="paython-by-learn" type="b2602c69:ProjectViewProjectNode" />
<item name="paython-by-learn" type="462c0819:PsiDirectoryNode" />
<item name="challenges60-68" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="paython-by-learn" type="b2602c69:ProjectViewProjectNode" />
<item name="paython-by-learn" type="462c0819:PsiDirectoryNode" />
@ -164,7 +172,7 @@
</list>
</option>
</component>
<component name="RunManager" selected="Python.challenge-077">
<component name="RunManager" selected="Python.challenge-079">
<configuration default="true" type="PythonConfigurationType" factoryName="Python">
<module name="paython-by-learn" />
<option name="INTERPRETER_OPTIONS" value="" />
@ -187,48 +195,13 @@
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="challenge-073" type="PythonConfigurationType" factoryName="Python" temporary="true">
<module name="paython-by-learn" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/challenges69-79" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/challenges69-79/challenge-073.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="true" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="challenge-074" type="PythonConfigurationType" factoryName="Python" temporary="true">
<module name="paython-by-learn" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/challenges69-79" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/challenges69-79/challenge-074.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="true" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="challenge-075" type="PythonConfigurationType" factoryName="Python" temporary="true">
<module name="paython-by-learn" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/challenges69-79" />
<option name="IS_MODULE_SDK" value="true" />
@ -248,6 +221,9 @@
<module name="paython-by-learn" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/challenges69-79" />
<option name="IS_MODULE_SDK" value="true" />
@ -267,6 +243,9 @@
<module name="paython-by-learn" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/challenges69-79" />
<option name="IS_MODULE_SDK" value="true" />
@ -282,13 +261,51 @@
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="challenge-078" type="PythonConfigurationType" factoryName="Python" temporary="true">
<module name="paython-by-learn" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/challenges69-79" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/challenges69-79/challenge-078.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="true" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="challenge-079" type="PythonConfigurationType" factoryName="Python" temporary="true">
<module name="paython-by-learn" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/challenges69-79" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/challenges69-79/challenge-079.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="true" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<recent_temporary>
<list>
<item itemvalue="Python.challenge-079" />
<item itemvalue="Python.challenge-078" />
<item itemvalue="Python.challenge-077" />
<item itemvalue="Python.challenge-076" />
<item itemvalue="Python.challenge-075" />
<item itemvalue="Python.challenge-074" />
<item itemvalue="Python.challenge-073" />
</list>
</recent_temporary>
</component>
@ -308,8 +325,9 @@
</component>
<component name="ToolWindowManager">
<frame x="-1" y="-4" width="1922" height="1085" extended-state="6" />
<editor active="true" />
<layout>
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.24986821" />
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.24986821" />
<window_info id="Structure" order="1" weight="0.25" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" />
@ -322,7 +340,7 @@
<window_info anchor="bottom" id="Educational.CheckDetails" order="8" />
<window_info anchor="bottom" id="Terminal" order="9" weight="0.32212028" />
<window_info anchor="bottom" id="Event Log" order="10" side_tool="true" />
<window_info anchor="bottom" id="Python Console" order="11" visible="true" weight="0.29153925" />
<window_info active="true" anchor="bottom" id="Python Console" order="11" visible="true" weight="0.27726808" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
@ -336,7 +354,8 @@
<MESSAGE value="second day of python challenges" />
<MESSAGE value="3rd day of python challenges 51-59" />
<MESSAGE value="3rd day of python challenges 60-68" />
<option name="LAST_COMMIT_MESSAGE" value="3rd day of python challenges 60-68" />
<MESSAGE value="4th day of python challenges 69-77" />
<option name="LAST_COMMIT_MESSAGE" value="4th day of python challenges 69-77" />
</component>
<component name="com.intellij.coverage.CoverageDataManagerImpl">
<SUITE FILE_PATH="coverage/paython_by_learn$challenge_039.coverage" NAME="challenge-039 Coverage Results" MODIFIED="1563282890417" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/challenges35-44" />
@ -619,7 +638,21 @@
<entry file="file://$PROJECT_DIR$/challenges69-79/challenge-077.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="120">
<caret line="8" column="16" lean-forward="true" selection-start-line="8" selection-start-column="16" selection-end-line="8" selection-end-column="16" />
<caret line="8" column="16" selection-start-line="8" selection-start-column="16" selection-end-line="8" selection-end-column="16" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/challenges69-79/challenge-078.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="120">
<caret line="8" lean-forward="true" selection-start-line="8" selection-end-line="8" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/challenges69-79/challenge-079.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="120">
<caret line="8" column="21" selection-start-line="8" selection-start-column="21" selection-end-line="8" selection-end-column="21" />
</state>
</provider>
</entry>

View File

@ -0,0 +1,8 @@
tv_program = ['GOT', 'Prison Break', 'Supernatural', 'Chernobyl ']
for i in tv_program:
print(i)
ask_name = str(input('Enter a name of show you want to add to list : '))
ask_position = int(input('Enter position of entered show in list : '))
tv_program.insert(ask_position, ask_name)
for i in tv_program:
print(i)

View File

@ -0,0 +1,13 @@
nums = []
count = 0
remove = False
while not remove:
if count == 3:
ask = str(input('Do you still want the last number they entered saved? yes|no : ')).lower()
if ask == 'no':
nums.pop(count-1)
remove = True
else:
nums.append(int(input('Enter number : ')))
count = count + 1
print(nums)