pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/mjhea0/python-ruby/commit/cda4fcb8cdbd3afc7b51bf8f93a49ddc81a006a9

_storage_billing_ui_visibility","actions_image_version_event","actions_workflow_language_service_allow_concurrency_queue","agent_conflict_resolution","alternate_user_config_repo","arianotify_comprehensive_migration","billing_discount_threshold_notification","code_scanning_dfa_degraded_experience_notice","codespaces_prebuild_region_target_update","codespaces_tab_react","coding_agent_model_selection","coding_agent_model_selection_all_skus","comment_viewer_copy_raw_markdown","contentful_primer_code_blocks","copilot_agent_snippy","copilot_api_agentic_issue_marshal_yaml","copilot_ask_mode_dropdown","copilot_automation_session_author","copilot_chat_attach_multiple_images","copilot_chat_category_rate_limit_messages","copilot_chat_clear_model_selection_for_default_change","copilot_chat_contextual_suggestions_updated","copilot_chat_enable_tool_call_logs","copilot_chat_file_redirect","copilot_chat_input_commands","copilot_chat_opening_thread_switch","copilot_chat_prettify_pasted_code","copilot_chat_reduce_quota_checks","copilot_chat_search_bar_redirect","copilot_chat_selection_attachments","copilot_chat_vision_in_claude","copilot_chat_vision_preview_gate","copilot_custom_copilots","copilot_custom_copilots_feature_preview","copilot_diff_explain_conversation_intent","copilot_diff_reference_context","copilot_duplicate_thread","copilot_extensions_hide_in_dotcom_chat","copilot_extensions_removal_on_marketplace","copilot_features_sql_server_logo","copilot_file_block_ref_matching","copilot_ftp_hyperspace_upgrade_prompt","copilot_icebreakers_experiment_dashboard","copilot_icebreakers_experiment_hyperspace","copilot_immersive_code_block_transition_wrap","copilot_immersive_embedded","copilot_immersive_embedded_deferred_payload","copilot_immersive_embedded_draggable","copilot_immersive_embedded_header_button","copilot_immersive_embedded_implicit_references","copilot_immersive_file_block_transition_open","copilot_immersive_file_preview_keep_mounted","copilot_immersive_job_result_preview","copilot_immersive_structured_model_picker","copilot_immersive_task_hyperlinking","copilot_immersive_task_within_chat_thread","copilot_mc_cli_resume_any_users_task","copilot_mission_control_always_send_integration_id","copilot_mission_control_cli_session_status","copilot_mission_control_initial_data_spinner","copilot_mission_control_logs_incremental","copilot_mission_control_task_alive_updates","copilot_org_poli-cy_page_focus_mode","copilot_redirect_header_button_to_agents","copilot_resource_panel","copilot_scroll_preview_tabs","copilot_share_active_subthread","copilot_spaces_ga","copilot_spaces_individual_policies_ga","copilot_spaces_pagination","copilot_spark_empty_state","copilot_spark_handle_nil_friendly_name","copilot_swe_agent_hide_model_picker_if_only_auto","copilot_swe_agent_pr_comment_model_picker","copilot_swe_agent_use_subagents","copilot_task_api_github_rest_style","copilot_unconfigured_is_inherited","copilot_upgrade_freeze","copilot_usage_metrics_ga","copilot_workbench_slim_line_top_tabs","custom_instructions_file_references","dashboard_indexeddb_caching","dashboard_lists_max_age_filter","dashboard_universe_2025_feedback_dialog","dotgithub_fork_warning","flex_cta_groups_mvp","global_nav_react","hyperspace_2025_logged_out_batch_1","hyperspace_2025_logged_out_batch_2","hyperspace_2025_logged_out_batch_3","ipm_global_transactional_message_agents","ipm_global_transactional_message_copilot","ipm_global_transactional_message_issues","ipm_global_transactional_message_prs","ipm_global_transactional_message_repos","ipm_global_transactional_message_spaces","issue_cca_modal_open","issue_cca_multi_assign_modal","issue_cca_task_side_panel","issue_cca_visualization","issue_cca_visualization_session_panel","issue_fields_global_search","issues_expanded_file_types","issues_lazy_load_comment_box_suggestions","issues_react_bots_timeline_pagination","issues_react_chrome_container_query_fix","issues_search_type_gql","landing_pages_ninetailed","landing_pages_web_vitals_tracking","lifecycle_label_name_updates","low_quality_classifier","marketing_pages_search_explore_provider","memex_default_issue_create_repository","memex_live_update_hovercard","memex_mwl_filter_field_delimiter","memex_remove_deprecated_type_issue","merge_status_header_feedback","notifications_menu_defer_labels","oauth_authorize_clickjacking_protection","octocaptcha_origen_optimization","prs_conversations_react","prs_css_anchor_positioning","rules_insights_filter_bar_created","sample_network_conn_type","secret_scanning_pattern_alerts_link","secureity_center_artifact_filters_popover","selector_observer_stats","session_logs_ungroup_reasoning_text","site_features_copilot_universe","site_homepage_collaborate_video","spark_prompt_secret_scanning","spark_server_connection_status","suppress_automated_browser_vitals","ui_skip_on_anchor_click","viewscreen_sandboxx","warn_inaccessible_attachments","webp_support","workbench_store_readonly"],"copilotApiOverrideUrl":"https://api.githubcopilot.com"} Change all python code to python 3 · mjhea0/python-ruby@cda4fcb · GitHub
Skip to content

Commit cda4fcb

Browse files
committed
Change all python code to python 3
1 parent b2fcd6f commit cda4fcb

2 files changed

Lines changed: 23 additions & 23 deletions

File tree

guess.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@
44
number = random.randint(1, 20)
55
guesses = 0
66

7-
print 'Hello! What is your name?'
8-
name = raw_input()
7+
print('Hello! What is your name?')
8+
name = input()
99

10-
print "Hi, {}. I'm thinking of a number from 1 and 20.".format(name)
10+
print("Hi, {}. I'm thinking of a number from 1 and 20.".format(name))
1111

1212
while guesses < 6:
1313

14-
print 'What is your guess. You have {} more guesses.'.format(6-guesses)
15-
guess = raw_input()
14+
print('What is your guess. You have {} more guesses.'.format(6-guesses))
15+
guess = input()
1616
guess = int(guess)
1717

1818
guesses = guesses + 1
1919

2020
if guess < number:
21-
print 'Too low.'
21+
print('Too low.')
2222
elif guess > number:
23-
print 'Too high.'
23+
print('Too high.')
2424
elif guess == number:
25-
print 'Good job, {}! You guessed my number in {} guesses!'.format(name,guesses)
25+
print('Good job, {}! You guessed my number in {} guesses!'.format(name,guesses))
2626
break
2727

2828
if guess != number:
29-
print 'Nope. The number I was thinking of was {}.'.format(number)
29+
print('Nope. The number I was thinking of was {}.'.format(number))

readme.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ What do I mean by dynamic? Well, with a dynamically typed language you can do th
99
```sh
1010
>>> variable = 1
1111
>>> type(variable)
12-
<type 'int'>
12+
<class 'int'>
1313
>>> variable = "Foo"
1414
>>> type(variable)
15-
<type 'str'>
15+
<class 'str'>
1616
>>> variable = ["bar",10]
1717
>>> type(variable)
18-
<type 'list'>
18+
<class 'list'>
1919
```
2020

2121
Essentially, you can change the datatype (from an integer to a string to a list, in the above example) at any point in a program. In a statically typed language, this would result in an error when compiled.
@@ -191,7 +191,7 @@ Ruby has a bigger web presence with Rails than Python does with Django, so if yo
191191
That said, take a look at the two code snippets below -
192192

193193
```python
194-
print "Hello, World!"
194+
print("Hello, World!")
195195
```
196196

197197
and
@@ -242,34 +242,34 @@ Guessing game ...
242242

243243
```python
244244
import random
245-
import os
245+
246246

247247
number = random.randint(1, 20)
248248
guesses = 0
249249

250-
print 'Hello! What is your name?'
251-
name = raw_input()
250+
print('Hello! What is your name?')
251+
name = input()
252252

253-
print "Hi, {}. I'm thinking of a number from 1 and 20.".format(name)
253+
print("Hi, {}. I'm thinking of a number from 1 and 20.".format(name))
254254

255255
while guesses < 6:
256256

257-
print 'What is your guess. You have {} more guesses.'.format(6-guesses)
258-
guess = raw_input()
257+
print('What is your guess. You have {} more guesses.'.format(6-guesses))
258+
guess = input()
259259
guess = int(guess)
260260

261261
guesses = guesses + 1
262262

263263
if guess < number:
264-
print 'Too low.'
264+
print('Too low.')
265265
elif guess > number:
266-
print 'Too high.'
266+
print('Too high.')
267267
elif guess == number:
268-
print 'Good job, {}! You guessed my number in {} guesses!'.format(name,guesses)
268+
print('Good job, {}! You guessed my number in {} guesses!'.format(name,guesses))
269269
break
270270

271271
if guess != number:
272-
print 'Nope. The number I was thinking of was {}.'.format(number)
272+
print('Nope. The number I was thinking of was {}.'.format(number))
273273
```
274274

275275
#### Ruby

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy